Adopt AddZbSerilog (Telemetry.Serilog 0.2.0) with MinimumLevelGovernor + ConfigureLogger #94
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ZB.MOM.WW.Telemetry.Serilog 0.2.0 (scadaproj#12, main 1ab5ca0 — not yet published to the feed) adds
AddZbSerilog(builder, configure, configureSerilog)withZbSerilogOptions.MinimumLevelGovernorandConfigureLogger, built to match ScadaBridge's ownLoggerConfigurationFactory(min-level key after ReadFrom.Configuration, standby active-node filter). Once 0.2.0 is published, switch ScadaBridge from its own factory to AddZbSerilog using those two hooks, and verify level governance + the standby filter are unchanged (tests + a rig boot log check). Blocked on publishing Telemetry 0.2.0.Done — ScadaBridge
main2d2e9f35.Library:
ZB.MOM.WW.Telemetry+ZB.MOM.WW.Telemetry.Serilog0.2.0 published to the Gitea feed 2026-11-12. Both were packed from scadaproj01c6dc1(the 0.2.0 code from1ab5ca0plus the corrected RepositoryUrl, before the unpublished 0.2.1 commit). Their tests were green in Release (12 + 30). The SHA256 of the feed download matches the local pack:ZB.MOM.WW.Telemetry.0.2.0.nupkg:71749cb3c34a0d0aba3eca43a6c12398b427f494e8c4c6f216db0be7d3ab40dcZB.MOM.WW.Telemetry.Serilog.0.2.0.nupkg:2aef391e7ab28061c5b3365c62c73e5c972ba8bcecd88bd0e0471550cfcc40c0Change:
ScadaBridgeLoggingbuilds the process logger withAddZbSerilog(..., s => { s.MinimumLevelGovernor = ...; s.ConfigureLogger = ...; }).ScadaBridge:Logging:MinimumLeveland runs afterReadFrom.Configuration, so it outranksSerilog:MinimumLevel. It never returns null.Override:*entries still apply, and the one-shot warnings are unchanged.active-nodefilter, the configuredSiteId/NodeRole/NodeHostname(the shared lib stampsNodeHostnamefromMachineNameand skips empty values, so an overwriting enricher keeps the configured values),FromLogContextandExecutionLogCaptureSink.AddZbSerilogruns on a small pre-host builder, andPrograminstalls the result as the staticLog.Logger. Both web hosts keepUseSerilog(). That leaves one logger and one file-sink handle per process. The startup banner, pre-hostFatal,SerilogAkkaLoggerand the post-dispose shutdown/Fatallines all keep working. The host's ownAddZbSerilogregistration would not setLog.Logger, and the container would dispose the logger.LoggerConfigurationFactoryis deleted; nothing else used it.Tests (Release): the existing logging, standby-filter and file-sink tests now run through the new pipeline. New
ScadaBridgeLoggingParityTestscover:Override:*still appliesNodeHostname!=MachineNameand an emptySiteIdtrace_id/span_idMutation check: five mutations, and each one fails tests:
FromLogContextremoved: 2 failHost.Tests: 695/695 after the rebase. Whole solution: 11,196 passed. The 185
CentralUI.PlaywrightTestsfailures are all environmental:ECONNREFUSED ws://localhost:3000, no Playwright browser server running.Rig boot check: I built the image from this commit and recreated all 8 nodes plus Traefik with the main checkout's compose file, central-a and central-b together.
MinimumLevel=Information. The console format[HH:mm:ss LVL] [Central/scadabridge-central-b]is the same as before./health/active(45 503 responses in its file log since the new boot) and site-a-b answered 503 on 10 out of 10 probes. Neither logged aHealth check active-nodeline. central-b still logs its genuineakka-clusterUnhealthy ERR, just as the old build did, which shows the filter is still keyed on the check name.logs/scadabridge-20261112.log, the same file as the previous boot.