Include scopes in logger

This commit is contained in:
Timothy Schenk 2022-12-31 17:30:27 +01:00
parent c4e2812ffd
commit 0da4341b99

View file

@ -14,6 +14,7 @@ ILoggerFactory loggerFactory = LoggerFactory.Create(builder =>
{
options.ColorBehavior = Microsoft.Extensions.Logging.Console.LoggerColorBehavior.Enabled;
options.TimestampFormat = "[HH:mm:ss]";
options.IncludeScopes = true;
});
builder.AddFile("Logs/log-{0:yyyy}-{0:MM}-{0:dd}.txt",
opts => opts.FormatLogFileName = fileName => String.Format(fileName, DateTime.UtcNow));