aboutsummaryrefslogtreecommitdiffstats
path: root/src/slskd
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2022-03-07 08:32:29 -0600
committerJP Dillingham <jpdillingham@gmail.com>2022-03-07 08:32:29 -0600
commitc634773eeb520c9b7a997d68651fafd4e93f64be (patch)
treee55c2bf53aca38b48e871d63f82eb71ddada1667 /src/slskd
parentcc79e2c9fd3ceeee81c34e44d697e59e8f1fb6a1 (diff)
downloadslskd-c634773eeb520c9b7a997d68651fafd4e93f64be.tar.gz
tweak context/subcontext
Diffstat (limited to 'src/slskd')
-rw-r--r--src/slskd/Program.cs7
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('"'),
};