Replies: 2 comments 2 replies
-
|
Yes, every logger library does need to be updated to support it, namely, they need to implement this interface https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.abstractions.ibufferedlogger - it is explained there in the Remarks section. Specifically for the OpenTelemetry .NET, the place where timestamp update is here - there is no any config. It just needs to implement the interface :) P.S. converted to a Discussion. |
Beta Was this translation helpful? Give feedback.
-
|
We implemented log buffering in our solution because the docs say:
Only when we were finished did we notice that the timestamps are in fact not preserved when using OpenTelemetry. IMHO the docs are misleading here and this should be mentioned, especially with all the promotion for Aspire. @evgenyfedorov2 Are there any plans for when this will be supported with OpenTelemetry? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I tried the log buffering and read through the proposal #5123 and discussion specific with the timestamping question. I also looked at the code and I see that the buffering does capture the timestamp before the log record gets written to the buffer. The .NET ConsoleLogger does print the correct timestamp (time of buffering).
Other log sinks (tried opentelemetry and serilog) seem to log the timestamp when the buffer is flushed (and first enters otel/serilog code), and do not use the timestamp the buffered logger code creates.
Can anyone just confirm these logger libraries need to be updated in order to use the correct timestamps and that the OpenTelemetry .NET log sink doesn't do that currently? Or is there a configuration to make them use the existing timestamps
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions