-
Notifications
You must be signed in to change notification settings - Fork 130
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
only custom logger appender on collector #240
Comments
hi @mosinnik! yes, this example should be fixed, the underlying logging instrumentation changed a few months ago and no longer uses the GlobalOpenTelemetry, and requires an explicit |
Even using the log4j.xml Pattern:
Log statement: // In my main:
val OTEL = AutoConfiguredOpenTelemetrySdk.initialize().openTelemetrySdk
OpenTelemetryAppender.install(OTEL)
// Within a trace context:
logger.info("{uuid=\"{}\",traceId=\"{}\"}: Received Request", uuid, Span.current().spanContext.traceId) Output does not contain the trace ID or span ID, but the logger line that manually grabbed the trace ID is reporting it:
|
this was fixed by #282 You can now see all the logs in the collector: Example:
|
The referenced MR was merged back in December 2023. In the comment I left, I was using OpenTelemetry version 1.37.0 which was released April 8th. This release would have included the referenced MR from December, so I don't believe that this has been fixed, since I was trying a later version of OpenTelemetry. |
@QuinnBast apologies for any confusion. I closed this issue because what was reported - appenders not being correctly installed to send messages to the collector in the documented examples - has been addressed and is working now. I could be mistaken but I don't think your comment is talking about the same thing? If that is the case, would you mind opening up a new issue detailing your problem? |
You might be right. I don't think my issue is specifically about the |
hi @QuinnBast, this is probably the component you're using? https://github.com/open-telemetry/opentelemetry-java-instrumentation/tree/main/instrumentation/log4j/log4j-appender-2.17/library if so you can open issue in that repo, thanks |
In log-appender example after running Application I found only custom appender logs in collectors logs.
Log4j, logback and also JUL logs lost.
Looks like lost setup of OpenTelemetryAppender because all work fine after adding follow code after
initializeOpenTelemetry();
(https://github.com/open-telemetry/opentelemetry-java-examples/blob/main/log-appender/src/main/java/io/opentelemetry/example/logappender/Application.java#L35)The text was updated successfully, but these errors were encountered: