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

codeless instrumentation of log4j2 breaks when AsyncLoggerContextSelector is set as contextSelector #1389

Closed
vargadan opened this issue Nov 23, 2020 · 3 comments · Fixed by #1419

Comments

@vargadan
Copy link

vargadan commented Nov 23, 2020

Expected behavior

Log4j2 log entries sent to the application insights workspace as trace entries.

Actual behavior

Log4j2 entries were not sent when relying on only codeless instrumentation with the 3.0.0 agent.
However, they were when configuring the AI appender in the log4j2.xml explicitly.

To Reproduce

Steps to reproduce the behavior:
add the -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector system property, you will see that log4j2 entries no more are sent to AI workspace as application trace.

Sample Application

https://github.com/vargadan/ai-log4j-reproducer

System information

Please provide the following information:

  • SDK Version: agent 3.0.0
  • OS type and version: Ubuntu 18.04
  • Application Server type and version (if applicable): Tomcat 9 (as of the current tomcat:jdk11-openjdk-slim image)
  • Using spring-boot? NO
  • Additional relevant libraries (with version, if applicable):
    log4j2 2.14.0

Logs

Turn on SDK logs and attach/paste them to the issue. If using an application server, also attach any relevant server logs.

Be sure to remove any private information from the logs before posting!

Screenshots

If applicable, add screenshots to help explain your problem.

@trask
Copy link
Member

trask commented Nov 23, 2020

Hi @vargadan, can you provide a small sample application that we can run to see/troubleshoot this issue?

@vargadan
Copy link
Author

vargadan commented Nov 23, 2020 via email

@trask
Copy link
Member

trask commented Dec 17, 2020

hey @vargadan, sorry for the late reply, great repro, I was able to see the issue, will fix in next release (3.0.1)

@ghost ghost locked as resolved and limited conversation to collaborators Jul 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants