improved logging again
This commit is contained in:
parent
1b6128f52a
commit
e7de64d04c
@ -59,11 +59,15 @@ namespace FarmmapsApi
|
||||
private static void ConfigureLogger(IServiceProvider serviceProvider)
|
||||
{
|
||||
var isMicrosoftNamespace = Matching.FromSource("Microsoft");
|
||||
var isSystem = Matching.FromSource("System");
|
||||
|
||||
Log.Logger = new LoggerConfiguration()
|
||||
.MinimumLevel.Information()
|
||||
.WriteTo.Logger(l => l.Filter.ByIncludingOnly(isMicrosoftNamespace)
|
||||
.WriteTo.Console(LogEventLevel.Warning))
|
||||
.MinimumLevel.Verbose()
|
||||
.WriteTo.Logger(l =>
|
||||
l.WriteTo.Logger(l2 => l2
|
||||
.Filter.ByExcluding(v => isMicrosoftNamespace(v) || isSystem(v))
|
||||
.WriteTo.Console())
|
||||
)
|
||||
.WriteTo.File(path: "Logs/log.log", rollingInterval: RollingInterval.Day)
|
||||
.CreateLogger();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user