[Bug] Log4j2 doesn't print traceid(mutableLogEvent)
Search before asking
- [X] I had searched in the issues and found no similar issues.
Apache SkyWalking Component
Java Agent (apache/skywalking-java)
What happened
Log4j2 doesn't print traceid. We've seen Log4j2 plugin doesn't enhance mutableLogEvent.
What you expected to happen
Logs can print traceid in all scenarios.
How to reproduce
log4j2: Use async tab print log asynchronously(not log4j2.contextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector) and ENABLE_THREADLOCALS was true, will use mutableLogEvent.
Anything else
When logEvent is mutableLogEvent , field doesn't containt "_$EnhancedClassField_ws", so it always print traceid "N/A".
Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
We don't declare we support mutableLogEvent. AFAIK.
I think this should not be an issue.
Why is it not supported? I see plugin only support log4jLogEvent and ringBufferLogEvent.
Why should? This is an open-source community. We don't have any responsibility to support anything.
It's simply not implemented, there's no reason on the "why". However, if you would like to support it, we welcome the contribution.
I just want to know if there's another reason because log is very important. I can try to support it.
I just want to know if there's another reason because log is very important. I can try to support it.
Nope, I think its just a missing point, feel free to file a PR to support it.