Set log level manually #4048
Replies: 2 comments 1 reply
-
Typically controlled with choice of methods like LogInformation vs LogWarning vs LogError etc. |
Beta Was this translation helpful? Give feedback.
-
Hi @bfaccruent In an ASP.NET application using OpenTelemetry, the log level is typically configured through the logging framework used by the application, such as Serilog or NLog. By default, OpenTelemetry will use the logging framework's default log level, which is typically Information. To override the log level used by OpenTelemetry, you can configure the logging framework to use a different log level. For example, if you are using Serilog, you can set the log level by adding the following configuration to your appsettings.json file:
This will set the log level for all loggers to Debug. You can also set the log level for specific loggers by using their logger name in the configuration. For example:
This will set the log level to Information for all loggers, except for the Microsoft logger which will use Warning, and the System logger which will use Error. Once you have configured the logging framework, OpenTelemetry will use the log level set by the logging framework. |
Beta Was this translation helpful? Give feedback.
-
Hi
I am using OpenTelemetry in my ASP.NET API app and I wonder where does it read the log level and can I override it ?
Beta Was this translation helpful? Give feedback.
All reactions