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