Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log4j2 log events are counted multiple times #22208

Closed
bol-com-pschmitz opened this issue Jul 3, 2020 · 1 comment
Closed

Log4j2 log events are counted multiple times #22208

bol-com-pschmitz opened this issue Jul 3, 2020 · 1 comment
Labels
for: external-project For an external project and not something we can fix

Comments

@bol-com-pschmitz
Copy link

bol-com-pschmitz commented Jul 3, 2020

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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 3, 2020
@wilkinsona
Copy link
Member

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.

@wilkinsona wilkinsona added for: external-project For an external project and not something we can fix and removed status: waiting-for-triage An issue we've not yet triaged labels Jul 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix
Projects
None yet
Development

No branches or pull requests

3 participants