github logfellow/logstash-logback-encoder logstash-logback-encoder-7.1

latest releases: logstash-logback-encoder-7.2, logstash-logback-encoder-7.1.1
4 months ago

Bug Fixes

  • #747/#748 Logger name shortening down to the class name (length set to zero). (@brenuart)

    When using a LogstashEncoder, the <shortenedLoggerNameLength> configuration property can be used to shorten the logger name as described in here. This feature is supposed to behave the same as the standard Logback length conversion word. However, although the logger name was properly shortened when the desired length was greater than zero, it did not produce the expected result when the length was set to 0. In fact, foo.bar.baz.MyClass was shortened to f.b.b.MyClass instead of MyClass.

  • #765 PatternJsonProvider: omitEmptyFields doesn't work with %property{key}. (@brenuart)

    The Logback %property{key} conversion specifier returns null when the property does not exists. This value is added as-is to the String evaluation of the pattern which ultimately gives the string "null" (in letters) that won't be filtered out by the omitEmptyField feature.
    To solve this issue, the PatternJsonProvider now uses a custom %property{key} converter that returns an empty string instead of null when the property does not exist. It also allows you to specify a default value to use when the property does not exist. People wanting to revert to the old behaviour can explicitly set the default value to "null" like this %property{key:-null}.

  • #751 Fixed wrong link in README.md for #event-specific-custom-fields (@mightymoogle)

Enhancements

  • #711 Fast Timestamp Format (@brenuart)

    The *FormattedTimestampJsonProvider are now faster than ever thanks to the introduction of a new FastISOTimestampFormat.

    This new formatter leverages the fact that in a logging scenario timestamps are mostly formatted in chronological order.
    Instead of computing every date/time fields like the standard DateTimeFormatter does each time it is invoked, the fast formatter remembers the previous formatted value and replaces the second and millis parts when the next timestamp to format is within the same minute. This strategy is 7x faster and produces 10x less garbage compared to the DateTimeFormatter.

    The "fast" formatter is used only when the provider is configured with one of the following standard ISO formats (obtained from the Java DateTimeFormatter). A standard DateTimeFormatter is used for the other standard formats or if a custom pattern is configured (even if the pattern matches one of the supported ISO formats).

    • ISO_OFFSET_DATE_TIME
    • ISO_ZONED_DATE_TIME
    • ISO_LOCAL_DATE_TIME
    • ISO_DATE_TIME
    • ISO_INSTANT
  • #772 PatternJsonProvider: support for default value in %property{key} (@brenuart)

    The %property{key} conversion specifier used by the PatternJsonProvider has been enhanced to add support for a default value to use when the property does not exist. The default value is optional and can be specified using the :- operator as in Bash shell. For example, assuming the property "foo" is not defined, %property{foo:-bar} will return bar.
    If no optional value is declared, the converter returns an empty string instead of null as does the original Logback version.
    Check the relevant section of the documentation for more information.

  • #743 Add new JsonProviders for exception messages (@twz123)

  • #773/#774 PatternJsonProvider: provide a "#asNullIfEmpty{}" operation (@brenuart)

  • #719/#720 getFieldValue() should return fieldValue without transforming it into a String (@brenuart)

  • #728 Custom JsonGenerator with optimized writeObject() for simple object types (@brenuart)

Project Improvements

  • #709 "no-response" bot not working anymore since the project was moved to the "logfellow" organisation (@philsttr)
  • #777 Upgraded maven 3.8.5 and maven wrapper (@philsttr)
  • #766/#786 Update license header template to match year 2022 (@brenuart)

Dependency version changes

UsageDependencyOld VersionNew Version
Runtimejackson2.13.02.13.2.20220328
Runtimelogback1.2.71.2.11
Compile-timecheckstyle9.19.2.1
Compile-timeanimal-sniffer-maven-plugin1.201.21
Compile-timemaven-bundle-plugin5.1.25.1.4
Compile-timemaven-clean-plugin3.1.03.2.0
Compile-timemaven-compiler-plugin3.8.13.10.0
Compile-timemaven-jar-plugin3.2.03.2.2
Compile-timemaven-javadoc-plugin3.3.13.3.2
Compile-timemaven-shade-plugin3.2.43.3.0
Compile-timenexus-staging-maven-plugin1.6.81.6.12
Test-timeassertj3.21.03.22.0
Test-timeawaitility4.1.14.2.0
Test-timejunit5.8.15.8.2
Test-timemockito4.0.04.4.0

Don't miss a new logstash-logback-encoder release

NewReleases is sending notifications on new releases.