async log

This commit is contained in:
ikpil 2023-04-24 23:18:48 +09:00
parent 6eb503c287
commit e5d7cca6c6
1 changed files with 4 additions and 3 deletions

View File

@ -25,13 +25,14 @@ public static class Program
.Enrich.WithThreadId()
.Enrich.WithThreadName()
.Enrich.WithProperty(ThreadNameEnricher.ThreadNamePropertyName, "main")
.WriteTo.LogMessageBroker(outputTemplate: format)
.WriteTo.Console(outputTemplate: format)
.WriteTo.File(
.WriteTo.Async(c => c.LogMessageBroker(outputTemplate: format))
.WriteTo.Async(c => c.Console(outputTemplate: format))
.WriteTo.Async(c => c.File(
"logs/log.log",
rollingInterval: RollingInterval.Day,
rollOnFileSizeLimit: true,
outputTemplate: format)
)
.CreateLogger();
Run();