diff options
| author | JP Dillingham <jpdillingham@gmail.com> | 2022-03-07 08:32:29 -0600 |
|---|---|---|
| committer | JP Dillingham <jpdillingham@gmail.com> | 2022-03-07 08:32:29 -0600 |
| commit | c634773eeb520c9b7a997d68651fafd4e93f64be (patch) | |
| tree | e55c2bf53aca38b48e871d63f82eb71ddada1667 /src | |
| parent | cc79e2c9fd3ceeee81c34e44d697e59e8f1fb6a1 (diff) | |
| download | slskd-c634773eeb520c9b7a997d68651fafd4e93f64be.tar.gz | |
tweak context/subcontext
Diffstat (limited to 'src')
| -rw-r--r-- | src/slskd/Program.cs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index 6a399a02..0857ef4d 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -277,11 +277,11 @@ namespace slskd .Enrich.WithProperty("ProcessId", ProcessId) .Enrich.FromLogContext() .WriteTo.Console( - outputTemplate: (OptionsAtStartup.Debug ? "[{SourceContext}] [{SoulseekContext}] " : string.Empty) + "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}") + outputTemplate: (OptionsAtStartup.Debug ? "[{SubContext}] " : string.Empty) + "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}") .WriteTo.Async(config => config.File( Path.Combine(AppDirectory, "logs", $"{AppName}-.log"), - outputTemplate: (OptionsAtStartup.Debug ? "[{SourceContext}] " : string.Empty) + "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}", + outputTemplate: (OptionsAtStartup.Debug ? "[{SubContext}] " : string.Empty) + "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}", rollingInterval: RollingInterval.Day)) .WriteTo.Conditional( e => !string.IsNullOrEmpty(OptionsAtStartup.Logger.Loki), @@ -293,7 +293,8 @@ namespace slskd var record = new LogRecord() { Timestamp = logEvent.Timestamp.LocalDateTime, - Context = logEvent.Properties["SourceContext"].ToString().TrimStart('"').TrimEnd('"'), + Context = logEvent.Properties["Context"].ToString().TrimStart('"').TrimEnd('"'), + SubContext = logEvent.Properties["SubContext"].ToString().TrimStart('"').TrimEnd('"'), Level = logEvent.Level.ToString(), Message = logEvent.RenderMessage().TrimStart('"').TrimEnd('"'), }; |
