I have an application in .net framework 4.8
, I’m using Application Insight and TelemetryClient
for logging. How can I set the default log severity for the application.
I know in .net core we can set it in appsettings.json like this
"Logging": {
"IncludeScopes": false,
"ApplicationInsights": {
"LogLevel": {
"Default": "Warning"
}
},
"LogLevel": {
"Default": "Warning"
}
}
But how can we do the same in .net framework
?
This is a sample of my code
public class MyLogger
{
private static TelemetryClient _telemetryClient;
public IMMLoggerCore()
{
_telemetryClient = new TelemetryClient();
}
public void Trace(string message)
{
_telemetryClient.TrackTrace(format, SeverityLevel.Verbose, customParams);
}
public void Information(string message)
{
_telemetryClient.TrackTrace(message, SeverityLevel.Information);
}
}