Skip to content
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

Self-diagnostics log file has strange content #2548

Closed
mkotsabiuk opened this issue Oct 29, 2021 · 7 comments · Fixed by #2810
Closed

Self-diagnostics log file has strange content #2548

mkotsabiuk opened this issue Oct 29, 2021 · 7 comments · Fixed by #2810
Labels
question Further information is requested

Comments

@mkotsabiuk
Copy link

Bug Report

I am using OpenTelemetry 1.1.0 (commit ce46d001d5ed08d91e7750b4859410330d57e7a7). Running [AspNetCore example] (https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/examples/AspNetCore) with target framework netcoreapp3.1, release configurations and OTEL_DIAGNOSTICS.json config file:

{
    "LogDirectory": ".",
    "FileSize": 1024,
    "LogLevel": "LogAlways"
}

After some requests to https://localhost:5001/WeatherForecast/ the log file Examples.AspNetCore.exe.41136.log was created.

Examples.AspNetCore.exe.41136.log

When I open .log file in Notepad++ I see there internal events generated by OpenTelemetry (logs) with some unsupported symbols:

image

But I am expecting to see there only logs.

@mkotsabiuk mkotsabiuk added the bug Something isn't working label Oct 29, 2021
@cijothomas
Copy link
Member

@xiang17 could you take a quick look and see if this is expected?

@mkotsabiuk
Copy link
Author

Thanks, @cijothomas, for assigning @xiang17 to check it.

@reyang reyang added question Further information is requested and removed bug Something isn't working labels Nov 10, 2021
@xiang17
Copy link
Contributor

xiang17 commented Nov 12, 2021

It is expected behavior. The file was never intended to be in a proper text format. The log is written in a fixed-size file in a circular way. Once reached to the end, the self-diagnostics module will even overwrite the log file with new logs from beginning.

The reason is described in #1258: The self-diagnostics module is designed to have minimal overhead and bounded resource usage to make it production-ready and developers worry-free from ever-growing log file(s).

@mkotsabiuk
Copy link
Author

Thank you, @xiang17, for explaining. I think it worth it to add this behavior into Remarks section because it was unexpected for me and I thought that I am doing something in the wrong way.

Does fixing it and making the log file to be in a proper text format will require a big overhead to SDK itself?

@mkotsabiuk
Copy link
Author

Hi @xiang17,

Any updates on this issue?

cc: @cijothomas @reyang

@Oberon00
Copy link
Member

I would also like to have that documented.

The reason is described in #1258: The self-diagnostics module is designed to have minimal overhead and bounded resource usage to make it production-ready and developers worry-free from ever-growing log file(s).

This will lead to even stranger content when the file starts again from the beginning, especially if this happens mid-stacktrace and you get something that looks like a normally formatted stack trace with impossible content.

I don't think "minimal-overhead" in that extreme sense is a desirable feature. I'd rather want a developer-friendly debug feature by default.

@Oberon00
Copy link
Member

@xiang17

The file was never intended to be in a proper text format.

What is the expected way to use this file then?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants