feat(logging): stamp ExecutionId/InstanceName/ScriptName on the Serilog LogContext per run (ScadaBridge#56)
The site script and alarm on-trigger launchers push the run identity onto LogContext for the run's lifetime and the host now enables Enrich.FromLogContext(), so log lines written on the run's own async call chain carry the id. Bounded part only: LogContext does not cross an Akka message hop, so Instance Actor/DCL/S&F lines and a site_events execution-id column remain open (documented in the step-logs design doc section 9). Claude-Session: https://claude.ai/code/session_01GT67AEHd2Acv1YPwGfXEoV
This commit is contained in:
@@ -92,6 +92,10 @@ public static class LoggerConfigurationFactory
|
||||
.Enrich.WithProperty("SiteId", siteId)
|
||||
.Enrich.WithProperty("NodeHostname", nodeHostname)
|
||||
.Enrich.WithProperty("NodeRole", nodeRole)
|
||||
// ScadaBridge#56: surface the ExecutionId/InstanceName/ScriptName the site script
|
||||
// launcher pushes onto LogContext, so lines written on a run's own call chain carry
|
||||
// the run's identity. See SiteRuntime ScriptRunLogScope for the (bounded) scope.
|
||||
.Enrich.FromLogContext()
|
||||
.Enrich.With(new TraceContextEnricher());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user