diff options
| author | JP Dillingham <jp@dillingham.me> | 2022-03-15 07:36:22 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-15 07:36:22 -0500 |
| commit | 0464030d853df284b97c8e12fd1338f9bf9649a3 (patch) | |
| tree | 3967eb7d33f1a073effe98754e5f6c418522f9cd /src/slskd/Program.cs | |
| parent | f28d1171d11007bbb931425e246f6d232341163a (diff) | |
| parent | 88850904cb1af6b92b7d9dad50c89fc1899d7d1a (diff) | |
| download | slskd-0464030d853df284b97c8e12fd1338f9bf9649a3.tar.gz | |
Merge pull request #386 from slskd/dnet-logs
Log distributed messages as debug, add distributed state
Diffstat (limited to 'src/slskd/Program.cs')
| -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('"'), }; |
