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

Log4j2Metrics reset by LoggingSystemShutdownListener #1205

Open
dpy1123 opened this issue Feb 17, 2023 · 0 comments
Open

Log4j2Metrics reset by LoggingSystemShutdownListener #1205

dpy1123 opened this issue Feb 17, 2023 · 0 comments

Comments

@dpy1123
Copy link

dpy1123 commented Feb 17, 2023

I find that the root logger's filter added by log4j2Metrics, reseted sometime after application started.

Since my applcation have multiple context, it will trigger ApplicationEnvironmentPreparedEvent multiple times, and with LoggingSystemShutdownListener and ConfigFileApplicationListener's mechanism, the configration instance in logContext will be replace multiple times, which will lose the filter add by log4j2Metrics.

For now I'm adding a SpringApplicationRunListener#start to rebind the log4j2Metrics, but since it's SpringApplicationRunListener it will also be triggered as many as context's amount. Want a good solution from team, thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants