You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When log4j2 and micrometer are present, Spring Boot installs io.micrometer.core.instrument.binder.logging.Log4j2Metrics to provide metrics about Log4j2 logging events. Unfortunately that class is flawed. It is implemented as a filter, but filters can be invoked multiple times and must not have any side effects!
In practice the filter is often called multiple times for the same log event (e.g. in the presence of multiple and/or async loggers) so that the counter is incremented too many times and the value becomes higher than the actual number of log events for each level.
Thanks for the report, but I think this will need to be addressed in Micrometer. I've subscribed to micrometer-metrics/micrometer#2176 so that we're aware of it's outcome, just in case changes in Spring Boot are necessary.
When log4j2 and micrometer are present, Spring Boot installs
io.micrometer.core.instrument.binder.logging.Log4j2Metrics
to provide metrics about Log4j2 logging events. Unfortunately that class is flawed. It is implemented as a filter, but filters can be invoked multiple times and must not have any side effects!In practice the filter is often called multiple times for the same log event (e.g. in the presence of multiple and/or async loggers) so that the counter is incremented too many times and the value becomes higher than the actual number of log events for each level.
See micrometer-metrics/micrometer#2176
The text was updated successfully, but these errors were encountered: