Closed xumix closed 1 year ago
Are you using it with serilog or without?
In both cases its more about configuring the logging framework instead, the built in logging framework allows you to configure levels based on logger name, and serilog has a filter plugin you can use that archives the same thing.
In both cases its more about configuring the logging framework instead, the built in logging framework allows you to configure levels based on logger name, and serilog has a filter plugin you can use that archives the same thing.
I'm using the built-in logging with NLog on top, I've tried configuring it like this:
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Trace",
"System": "Information",
"OpenTracing": "Warning",
"Jaeger": "Warning",
"Microsoft": "Warning",
"Microsoft.EntityFrameworkCore.Database.Command": "Information",
"Hangfire": "Debug"
},
"Hangfire": {
"Default": "Debug",
"System": "Information",
"OpenTracing": "Warning",
"Jaeger": "Warning",
"Microsoft": "Warning"
}
But still got Trace messages in console
Well if i was guessing it would have been what you just wrote, i sadly dont know exactly what is wrong. if i where you i would enable debug symbols for system.logging and and step into a logging call.
Also have you tried to add that to my sample if it works there i think it's a problem with nlog?
Well if i was guessing it would have been what you just wrote, i sadly dont know exactly what is wrong. if i where you i would enable debug symbols for system.logging and and step into a logging call.
https://github.com/AnderssonPeter/Hangfire.Console.Extensions/blob/master/Hangfire.Console.Extensions/HangfireLogger.cs#L20= maybe this is the problem?
That might be the case, could you provide a pr?
Closed du to inactivity, please reopen if needed!
@xumix The ProviderAliasAttribute is missing on the HangfireLoggerProvider. Therefore, it is not possible to configure log levels to filter logs. I created a pr to fix that.
https://github.com/AnderssonPeter/Hangfire.Console.Extensions/pull/15
There is no configuration for Hangfire.Console in the sample project appsettings.json
For Example, I want
System.*
be logged to console withWarning
level but all myApp.*
logger be logged withDebug
level