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, 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 for #event-specific-custom-fields (@mightymoogle)


  • #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).

  • #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

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

NewReleases is sending notifications on new releases.