Releases: jhannes/logevents
Security advisories fixes
Test dependencies postgresql and h2 had several security advisories and have been upgraded.
In addition, the following minor improvements:
LogEventRule
new methodsassertNoMessages(Level)
andclear()
- SlackLogEventObserver.detailUrl should treat "" as missing value
- Short-circuit LogEventPredicates for AND and OR with Always and Never
🚨Package reorganization
I reviewed the package structure and architecture documentation of logevents. This upgrade will have compile breakages of dependencies and import statements will have to be replaced.
- As
NullLogEventObserver
is movedorg.logevents.{observers => core}
you can no longer doobserver.null=NullLogEventObserver
. But as a compensation, a NullEventObserver namednull
is available by default, so you don't have to - 🐞 BUGFIX:
ConsoleJsonLogEventFormatter
reads default configuration to setupapplicationName
andhostname
Support for slf4j 2.0
Support for slf4j 2.0.0-alpha5
HOTFIX: Bug with case-insensitivity of logger names
Logger names are being treated as case-insensitive. However, we want e.g. org.example.App
(class name), org.example.app
(package name) and ORG.EXAMPLE.APP
(environment variable) to always have the same configuration, even if log events should have different logger names. Before this fix, initial configurations would have the same configuration, but if a logger is changed runtime, aliased loggers are not refreshed.
More flexible filtering + HumioLogEventObserver
- Support LogEventFilter for filtered observers. E.g.
observer.foo.filter=INFO,DEBUG@marker=IMPORTANT
- Support decreasing logging for a specified filter, e.g.
logger.org.example=DEBUG,WARN@marker=BORING
- Support threshold NONE in LogEventFilter, e.g.
logger.org.example=NONE,WARN@marker=INTERESTING
logger.org.example=INFO,NONE@marker=BORING
- Humio support. Hat tip @norrs
Bugfixes
- JsonLogEventFormatter now support arbitrary extra properties in log messages
- Support for threshold NONE
- BUGFIX: Loggers configured from environment should not have UPPER CASE names
- BUGFIX: Observers configured from environment must have case insensitive names
Bugs and documentation
- 🐛 BUGFIX: LOGEVENTS_STATUS value was not read from environment variables
- 🐛 BUGFIX: Deduplicate duplicate observers
- 🐛 BUGFIX: NullPointerException in SlakcLogEventObserver when MDC has null value
- Refactor: Move internal org.logevents.web package to org.logevents.observers.web
- Reorganization of org.logevents.config.Configuration to reduce duplication and order methods more logical
- More javadoc
Global environment variables
- Global environment variables should be prefixed with
LOGEVENTS_
, notobserver.*
- Default threshold varies for different observers
More flexible filtering of loggers and observers
The structure from LoggerDelegator (Logger-implementation) to LogEventGenerators to LogObservers have been restructured, replacing LoggerDelegator.threshold with a more flexible filter-concept. This allows for filtering loggers based on markers and MDCs. At the same time, support for filtering observers on MDC has been added.
Example configuration:
logger.org.example.app=INFO,DEBUG@mdc:user=superuser|admin|tester fileObserver,foo
logger.org.example.app.database=INFO,DEBUG@mdc:user=tester&marker=PERFORMANCE
observer.foo.suppressMarkers=HTTP_NOT_MODIFIED
observer.foo.requireMarker=HTTP
observer.foo.requireMdc.user=tester
observer.foo.suppressMdc.requestPath=/status
In this case, DEBUG messages from org.example.app will be logged to fileObserver if the user on the MDC is superuser, admin or tester and additionally to the observer "foo" if they contain the marker HTTP, but not the marker HTTP_NOT_MODIFIED, but only if the user is tester and the requestPath is not /status
Similarly, messages to the logger org.example.app.database will only be logged if the user is tester and the marker is additionally PERFORMANCE.
Filters on loggers are applied before creating the LogEvent, providing a performance gain.
Fix to Markers
- Containment-logic for markers was reversed
- Support
observer.console.showMarker
configuration - Support
includedMdcKeys
andexcludedMdcKeys
on PatternLogEventFormatter