Show that ApplicationInsightsLoggerProvider defaults to Warning only if there is no config
https://github.com/microsoft/ApplicationInsights-dotnet/blob/405fd6a9916956f2233520c8ab66110a1f9dcfbc/examples/ConsoleApp/Program.cs#L49
show that
logger.LogInformation("not logged");
Not sure what exactly you meant. There is no defaults by ApplicationInsightsLoggerProvider in a console app. Whatever is the configuration for the application, is applied to ApplicationInsightsLoggerProvider, just like any other provider.
If you don't have a config, and try to logger.LogInfo, it won't log to App insights.
This is due to https://github.com/microsoft/ApplicationInsights-dotnet/blob/main/NETCORE/src/Shared/Extensions/ApplicationInsightsExtensions.cs#L427
Thanks for clarifying. Its already covered in the docs : https://docs.microsoft.com/en-us/azure/azure-monitor/app/worker-service , but would be nice to mention in the examples in this repo too.
Thanks for clarifying. Its already covered in the docs
To be more specific. It is documented here: https://learn.microsoft.com/en-us/azure/azure-monitor/app/worker-service#ilogger-logs and in the C# log warning example lines.
logger.LogWarning("A sample warning message. By default, logs with severity Warning or higher is captured by Application Insights");
It would be nice if there was a line under it
logger.LogInformation("Lower than Warning is not logged if detaults are used");
to help developers who get the sample, add info logs and then look for them.
This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.
Could the Info be added?