Persist the tentacle agent log to a rotated file under the service#426
Merged
Conversation
The tentacle logger wrote to the console only. A Windows-SCM-launched
service has no console (writes go to NUL), so its entire runtime log was
lost — operators had nothing to inspect after a failure. The single
Windows-persistent file, the SCM-startup diagnostic, was append-only with
no size cap.
Add a size-rotated Serilog file sink (50 MB x 5 files) gated to the
managed-service launch, written under {system-config-dir}/logs. Short-lived
CLI commands stay console-only so they don't litter a log file per
invocation; on Linux journald already persists the console, so the sink
targets the Windows-service gap. Best-effort directory creation never blocks
service start. Also bound the append-only SCM-startup diagnostic with a
single-generation size rotation.
ppXD
force-pushed
the
fix/windows-persistent-agent-log
branch
from
June 10, 2026 10:04
cd14aef to
b01e58e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
TentacleLogginghelper, gated to the managed-service launch (ShouldRunUnderScm). Short-lived CLI commands (version,register, …) stay console-only so they don't litter a log file per invocation. On Linux/systemd the console is already captured by journald, so the sink targets the Windows-service gap specifically. Directory creation is best-effort — a log file can never block the service from starting.RotateIfOversized, 1 MB →.old).Serilog.Sinks.Filepackage.Test plan
tentacle.log/logs/ 1 MB SCM cap);ResolveAgentLogPathunder{system-config-dir}/logsRotateIfOversizedunder-limit no-op / over-limit →.old+ truncate / missing-file no-throwSquid.Tentacle.TestsCore/Entry/Scm 102/102 green; full suite green except 5 disk-gatedRunningScriptReporterTeststhat fail on a near-full dev disk (DiskSpaceChecker10% floor — environmental, branch-independent, untouched by this change; passes on CI)dotnet build Squid.sln0 errors