We should consider adding support for the OpenTelemetry Logging specification to Log4j API 3.x.
This would require:
- creating a new
log4j-otel bridge that implements LoggerProvider,
- enhance the Log4j API to help with implementation of
log4j-otel. I am mostly concerned about the LogRecordBuilder#setContext method, i.e. a way to programmatically inject context data into a logging event like we do with LogBuilder#withLocation for the location data. We obviously don't expect users to add context data manually in their code, but some instrumentation can do it the same way we inject location with Log4j Transformer Maven plugin.
What do you think?
We should consider adding support for the OpenTelemetry Logging specification to Log4j API 3.x.
This would require:
log4j-otelbridge that implementsLoggerProvider,log4j-otel. I am mostly concerned about theLogRecordBuilder#setContextmethod, i.e. a way to programmatically inject context data into a logging event like we do withLogBuilder#withLocationfor the location data. We obviously don't expect users to add context data manually in their code, but some instrumentation can do it the same way we inject location with Log4j Transformer Maven plugin.What do you think?