-
Notifications
You must be signed in to change notification settings - Fork 859
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
MDC attributes not captured with spring boot application using log4j. #12540
Comments
hi @nityanandagohain, are you using the OpenTelemetry Spring Boot starter or the OpenTelemetry Java agent or the OpenTelemetry Log4j Appender artifact? |
hi @trask I am using the otel java agent here is the code that I am using to test it https://github.com/nityanandagohain/otel_log4j this is the run command I am using
|
my first guess would be that it's a shell quoting issue, maybe try
|
Capturing the class/method/line that logged the message is currently not implemented for log4j. It is implemented for logback. Logger name is set as |
hi @nityanandagohain, if you can create a new issue targeted at that feature (and closing this issue), we will tag it as "contribution welcome". |
I am using log4j in my spring boot application. The issue that I am facing is that the MDC attributes are not captured even after adding
otel.instrumentation.log4j-appender.experimental.capture-mdc-attributes=*
. Do I need to configure anything else ?The other settings like
otel.instrumentation.log4j-appender.experimental-log-attributes
work as as expected.update: I am able to get mdc attributes if I add them
But how do I capture attributes like className / LoggerName ?
The text was updated successfully, but these errors were encountered: