-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Duplicated logs with Elastic APM Agent - Quarkus wrongly importing log4j2 configuration from agent #40009
Comments
/cc @dmlloyd (logging) |
Quarkus does not use log4j2 for logging. I think the most likely possibility is that the log4j2 in the APM agent is configured, installing a JUL Handler as a part of its setup, causing the Quarkus log manager (based on JUL) to log once via JUL and to unknowingly delegate to log4j again via the injected handler (I don't see how TCCL would be involved in this though). I'll continue investigating this but I think that this is likely a natural consequence of having two logging systems running in the same JVM. We might be able to provide a workaround of some kind but not a fix, if this is indeed caused by log4j2 injecting a redirection handler. |
To add on to this, it could be a good idea to introduce an implementation of the APM agent's logger which uses |
It looks like my initial evaluation is incorrect; there is actually a bug in the log manager itself. I've opened LOGMGR-350 to track it. |
Describe the bug
Using any APM agent starting in version 1.30.0 will make Quarkus to duplicate all its logs. Opened a jira in Elastic and they found the agent modification that started the behaviour but explain that it's Quarkus responsability to not add any log config from agent to main app:
elastic/apm-agent-java#3563
Maybe related to:
#7640
#2152
Expected behavior
Normal both quarkus app and agent logs
Actual behavior
All app logs get duplicated, second one with different format.
How to Reproduce?
Explained here:
elastic/apm-agent-java#3563
Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
No response
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
No response
The text was updated successfully, but these errors were encountered: