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

SelfDiagnosticsModule doesn't filter out logs of lower severity level as configured #1689

Closed
xiang17 opened this issue Jan 12, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@xiang17
Copy link
Contributor

xiang17 commented Jan 12, 2021

Bug Report

List of NuGet packages and
version that you are using (e.g. OpenTelemetry 0.4.0-beta.2):

  • All that has Self Diagnostics modules

Runtime version (e.g. net461, net48, netcoreapp2.1, netcoreapp3.1, etc.
You can find this information from the *.csproj file):

  • All .NET Frameworks has this issue. (All versions of .NET Core are free of this issue.)

Symptom

Create a file "OTEL_DIAGNOSTICS.json" with content in folder "docs/trace/getting-started":

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

Run command in the same folder: dotnet run --configuration Release --framework net472 --project getting-started.csproj

Bug#1

A file would be generated with content:

Successfully opened file.2021-01-09T05:57:36.7394837Z:Activity started. OperationName = '{0}', Id = '{1}'.{Foo}{00-f02701bfe384804ea468f9f4770c6d2e-13c2dca1b5ebc549-01}
2021-01-09T05:57:36.7764812Z:Activity started. OperationName = '{0}', Id = '{1}'.{Bar}{00-f02701bfe384804ea468f9f4770c6d2e-7f5b345dbb1b624a-01}
2021-01-09T05:57:36.7774818Z:Activity started. OperationName = '{0}', Id = '{1}'.{Baz}{00-f02701bfe384804ea468f9f4770c6d2e-74abb7d3cce3f944-01}
2021-01-09T05:57:36.7954830Z:Activity stopped. OperationName = '{0}', Id = '{1}'.{Baz}{00-f02701bfe384804ea468f9f4770c6d2e-74abb7d3cce3f944-01}
2021-01-09T05:57:36.8824836Z:Activity stopped. OperationName = '{0}', Id = '{1}'.{Bar}{00-f02701bfe384804ea468f9f4770c6d2e-7f5b345dbb1b624a-01}
2021-01-09T05:57:36.8834843Z:Activity stopped. OperationName = '{0}', Id = '{1}'.{Foo}{00-f02701bfe384804ea468f9f4770c6d2e-13c2dca1b5ebc549-01}

Bug#2

There is also a separate issue that this file cannot be opened (even in read-only mode) by text editor when the program is running.

Untitled - Notepad 1_12_2021 4_49_57 PM

What is the expected behavior?

The issues don't happen for .NET Core: Run command dotnet run --configuration Release --framework netcoreapp3.1 --project getting-started.csproj:

A file should be generated with content:

Successfully opened file.

Activity started/stopped events are Verbose level. They should be omitted by self diagnostics module when LogLevel is set to Error, according to EventListener.EnableEvents and EventLevel documentation.

The file should be able to be opened, at least in read-only mode.

What did you expect to see?

See above. Running in .NET Frameworks should be the same as in result of .NET Core.

What is the actual behavior?

See above.

What did you see instead?

See above.

@cijothomas
Copy link
Member

@xiang17 Please confirm if this is already fixed and can be closed.

@xiang17
Copy link
Contributor Author

xiang17 commented Apr 21, 2021

Yes it's already fixed.

@xiang17 xiang17 closed this as completed Apr 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants