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

Application Insights .NET SDK does not respect LogLevel.None #2666

Closed
vmcbaptista opened this issue Aug 24, 2022 · 5 comments
Closed

Application Insights .NET SDK does not respect LogLevel.None #2666

vmcbaptista opened this issue Aug 24, 2022 · 5 comments
Labels

Comments

@vmcbaptista
Copy link
Contributor

Repro steps:
Create an ASP.NET Core application with Application Insights configured.

Add a log like this: _logger.Log(LogLevel.None, "Do not show")

Actual behavior:

  • Log is sent to application insights and is visible in the query editor with severitylevel = 0

Expected behavior:

  • Log is not sent to application insights
@cijothomas
Copy link
Contributor

Known issue/feature/bug/capability!

But I do not know why ilogger even sends the LogLevel.None to the providers (like ApplicationInsights!).

@vmcbaptista
Copy link
Contributor Author

vmcbaptista commented Aug 24, 2022

Known issue/feature/bug/capability!

But I do not know why ilogger even sends the LogLevel.None to the providers (like ApplicationInsights!).

Yeah, to be fair I never used this loglevel, but I'm depending on a library that uses it and I'm getting a lot of unwanted messages in AI 😟

Is this something you plan to fix at AI SDK, or shall we rather raise this to the .NET logging team?

@cijothomas
Copy link
Contributor

Since all other providers are doing this check, probably makes sense for application insights to do this as well.

@vmcbaptista
Copy link
Contributor Author

Cool. Would be possible to have any ETA about when this could be fixed and released? Is this something I cal help with PR?

@cijothomas
Copy link
Contributor

No ETA. This is not a high priority item.

Happy to accept a PR if you can send one! it should be straightforward.
https://github.com/microsoft/ApplicationInsights-dotnet/blob/main/LOGGING/src/ILogger/ApplicationInsightsLogger.cs#L68 This is where we need change.

This is a reference https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.Extensions.Logging.Console/src/ConsoleLogger.cs#L70

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

No branches or pull requests

3 participants