tgstation-server 6.18.0
The /tg/station 13 server suite
|
Helpers for manipulating the Serilog.Context.LogContext. More...
Static Public Member Functions | |
static void | AddSwarmNodeIdentifierToTemplate () |
Adds the placeholder for the SwarmIdentifierContextProperty to the Template. | |
Static Public Attributes | |
const string | InstanceIdContextProperty = "Instance" |
The Serilog.Context.LogContext property name for Models.Instance Api.Models.EntityId.Ids. | |
const string | JobIdContextProperty = "Job" |
The Serilog.Context.LogContext property name for Models.Job Api.Models.EntityId.Ids. | |
const string | RequestPathContextProperty = "Request" |
The Serilog.Context.LogContext property name for Models.User Api.Models.EntityId.Ids. | |
const string | UserIdContextProperty = "User" |
The Serilog.Context.LogContext property name for Models.Instance Api.Models.EntityId.Ids. | |
const string | WatchdogMonitorIterationContextProperty = "Monitor" |
The Serilog.Context.LogContext property name for the ID of the watchdog monitor iteration currently being processed. | |
const string | BridgeRequestIterationContextProperty = "Bridge" |
The Serilog.Context.LogContext property name for the ID of the bridge request currently being processed. | |
const string | ChatMessageIterationContextProperty = "ChatMessage" |
The Serilog.Context.LogContext property name for the ID of the chat message currently being processed. | |
const string | InstanceReferenceContextProperty = "InstanceReference" |
The Serilog.Context.LogContext property name for Components.IInstanceReference.Uids. | |
const string | SwarmIdentifierContextProperty = "Node" |
The Serilog.Context.LogContext property name for Api.Models.Internal.SwarmServer.Identifiers. | |
Properties | |
static string | Template [get, private set] |
Common template used for adding our custom log context to serilog. | |
Static Private Member Functions | |
static | SerilogContextHelper () |
Initializes static members of the SerilogContextHelper class. | |
Static Private Attributes | |
const string | DefaultTemplate = $"Instance:{{{InstanceIdContextProperty}}}|Job:{{{JobIdContextProperty}}}|Request:{{{RequestPathContextProperty}}}|User:{{{UserIdContextProperty}}}|Monitor:{{{WatchdogMonitorIterationContextProperty}}}|Bridge:{{{BridgeRequestIterationContextProperty}}}|Chat:{{{ChatMessageIterationContextProperty}}}|IR:{{{InstanceReferenceContextProperty}}}" |
The default value of Template. | |
Helpers for manipulating the Serilog.Context.LogContext.
Definition at line 6 of file SerilogContextHelper.cs.
|
staticprivate |
Initializes static members of the SerilogContextHelper class.
Definition at line 67 of file SerilogContextHelper.cs.
References Tgstation.Server.Host.Utils.SerilogContextHelper.DefaultTemplate, and Tgstation.Server.Host.Utils.SerilogContextHelper.Template.
|
static |
Adds the placeholder for the SwarmIdentifierContextProperty to the Template.
Definition at line 75 of file SerilogContextHelper.cs.
References Tgstation.Server.Host.Utils.SerilogContextHelper.Template.
|
static |
The Serilog.Context.LogContext property name for the ID of the bridge request currently being processed.
Definition at line 36 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Controllers.BridgeController.Process().
|
static |
The Serilog.Context.LogContext property name for the ID of the chat message currently being processed.
Definition at line 41 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Components.Chat.ChatManager.MonitorMessages().
|
staticprivate |
The default value of Template.
Definition at line 56 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Utils.SerilogContextHelper.SerilogContextHelper().
|
static |
The Serilog.Context.LogContext property name for Models.Instance Api.Models.EntityId.Ids.
Definition at line 11 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Components.Instance.DisposeAsync(), Tgstation.Server.Host.Controllers.ApiController.HookExecuteAction(), Tgstation.Server.Host.Components.Session.SessionController.ProcessBridgeRequest(), Tgstation.Server.Host.Components.Instance.StartAsync(), and Tgstation.Server.Host.Components.Instance.StopAsync().
|
static |
The Serilog.Context.LogContext property name for Components.IInstanceReference.Uids.
Definition at line 46 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Controllers.ComponentInterfacingController.WithComponentInstanceNullable().
|
static |
The Serilog.Context.LogContext property name for Models.Job Api.Models.EntityId.Ids.
Definition at line 16 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Jobs.JobService.RunJob().
|
static |
The Serilog.Context.LogContext property name for Models.User Api.Models.EntityId.Ids.
Definition at line 21 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Controllers.ApiController.HookExecuteAction(), and Tgstation.Server.Host.Controllers.SwarmController.HookExecuteAction().
|
static |
The Serilog.Context.LogContext property name for Api.Models.Internal.SwarmServer.Identifiers.
Definition at line 51 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Extensions.ApplicationBuilderExtensions.UseAdditionalRequestLoggingContext().
|
static |
The Serilog.Context.LogContext property name for Models.Instance Api.Models.EntityId.Ids.
Definition at line 26 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Controllers.ApiController.HookExecuteAction().
|
static |
The Serilog.Context.LogContext property name for the ID of the watchdog monitor iteration currently being processed.
Definition at line 31 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Components.Watchdog.WatchdogBase.MonitorLifetimes().
|
staticgetprivate set |
Common template used for adding our custom log context to serilog.
Should not be changed. Only mutable for the sake of identifying swarm nodes under a single test environment
Definition at line 62 of file SerilogContextHelper.cs.
Referenced by Tgstation.Server.Host.Utils.SerilogContextHelper.AddSwarmNodeIdentifierToTemplate(), and Tgstation.Server.Host.Utils.SerilogContextHelper.SerilogContextHelper().