-
Notifications
You must be signed in to change notification settings - Fork 893
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
Global accessor for LogEmitterProvider #2332
Comments
Why doesn't the appender use auto configured |
@wallezhang |
Yeah, I know, however, I think it will be very strange to use this way. For example, I initialized the SDK by agent, I still need to manually initialize a |
@wallezhang You should be using slf4j if you need to write log messages, not the logs SDK. If you have a strong case needing the OpenTelemetry logging functionality, could you add a comment to #2234 with details of your use case? Currently, the answer is that your use case is not supported by OpenTelemetry so we would need some big discussion in the specification repo to make it supported.
|
@anuraaga Yes, of course I will use slf4j to print log in application. But I think the appender provided in the instrumentation library is a little complicated to use. When I use java agent to initialize whole SDK, I need to inject a Maybe we can simplify usage by injecting the autoconfigured |
Oh if you're trying to use the javaagent to add an appender to logback or log4j to send OpenTelemetry logs, that injection should indeed be happening automatically here Are you seeing the appender not get initialized fully automatically when using the javaagent? If so we can file an issue in the java instrumentation repo for that. |
Thanks for reply. I'll try it first. |
FYI, the following link from the original post is now dead:
So here is an updated permalink: setter for the log4j appender |
This was resolved in #2676. There's now explicit text stating:
|
Should there be a global accessor for LogEmitterProvider? In java (discussed here) we think the answer is no because the global accessor is reserved for API components (i.e. MeterProvider, TracerProvider) and there is no log API.
Instead, each appender we publish has a global setter for configuring the
LogEmitterProvder
. For example, here is the setter for the log4j appender.The text was updated successfully, but these errors were encountered: