tgstation-server 6.12.0
The /tg/station 13 server suite
Loading...
Searching...
No Matches
SerilogContextHelper.cs
Go to the documentation of this file.
2{
6 public static class SerilogContextHelper
7 {
11 public const string InstanceIdContextProperty = "Instance";
12
16 public const string JobIdContextProperty = "Job";
17
21 public const string RequestPathContextProperty = "Request";
22
26 public const string UserIdContextProperty = "User";
27
31 public const string WatchdogMonitorIterationContextProperty = "Monitor";
32
36 public const string BridgeRequestIterationContextProperty = "Bridge";
37
41 public const string ChatMessageIterationContextProperty = "ChatMessage";
42
46 public const string InstanceReferenceContextProperty = "InstanceReference";
47
51 public const string SwarmIdentifierContextProperty = "Node";
52
56 const string DefaultTemplate = $"Instance:{{{InstanceIdContextProperty}}}|Job:{{{JobIdContextProperty}}}|Request:{{{RequestPathContextProperty}}}|User:{{{UserIdContextProperty}}}|Monitor:{{{WatchdogMonitorIterationContextProperty}}}|Bridge:{{{BridgeRequestIterationContextProperty}}}|Chat:{{{ChatMessageIterationContextProperty}}}|IR:{{{InstanceReferenceContextProperty}}}";
57
62 public static string Template { get; private set; }
63
71
76 {
77 Template = $"{DefaultTemplate}|Node:{{{SwarmIdentifierContextProperty}}}";
78 }
79 }
80}
Helpers for manipulating the Serilog.Context.LogContext.
const string ChatMessageIterationContextProperty
The Serilog.Context.LogContext property name for the ID of the chat message currently being processed...
const string InstanceIdContextProperty
The Serilog.Context.LogContext property name for Models.Instance Api.Models.EntityId....
static SerilogContextHelper()
Initializes static members of the SerilogContextHelper class.
const string JobIdContextProperty
The Serilog.Context.LogContext property name for Models.Job Api.Models.EntityId.Ids.
const string InstanceReferenceContextProperty
The Serilog.Context.LogContext property name for Components.IInstanceReference.Uids.
const string SwarmIdentifierContextProperty
The Serilog.Context.LogContext property name for Api.Models.Internal.SwarmServer.Identifiers.
const string WatchdogMonitorIterationContextProperty
The Serilog.Context.LogContext property name for the ID of the watchdog monitor iteration currently b...
const string UserIdContextProperty
The Serilog.Context.LogContext property name for Models.Instance Api.Models.EntityId....
const string BridgeRequestIterationContextProperty
The Serilog.Context.LogContext property name for the ID of the bridge request currently being process...
const string RequestPathContextProperty
The Serilog.Context.LogContext property name for Models.User Api.Models.EntityId.Ids.
static string Template
Common template used for adding our custom log context to serilog.
const string DefaultTemplate
The default value of Template.
static void AddSwarmNodeIdentifierToTemplate()
Adds the placeholder for the SwarmIdentifierContextProperty to the Template.