I’m using Nlog as a logger provider and nlog.config file with filters to ignore specific logs.
But I face with a problem to ignore logs with parameter className which equal to “Diagnostics”:
{ "time": "2024-05-11 13:25:43.7657", "message": "Request finished HTTP/1.1 GET http://localhost/api/v1/someApi - - - 200 - application/json", "level": "INFO", "className": "Diagnostics" }
I tryed to use condition rule:
<when condition="'${var:className}' == 'Diagnostics'" action="Ignore" />
also tryed to use appsettings.json logging configs:
`
"LogLevel": {
"Default": "Warning",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Warning",
"System.Diagnostics": "None",
"Microsoft.AspNetCore": "Critical"
}
Are there ways to ignore logs by class name?
I’m trying to ignore all logs with className “Diagnostics”
I’m expecting clear log file without any logs with className Diagnostics