serverboot: dynamic --log-level flag for the server binaries - #677
Merged
Max Smythe (maxsmythe) merged 4 commits intoAug 1, 2026
Merged
Conversation
A slog.LevelVar behind the serverboot loggers, settable from a new --log-level flag (debug, info, warn, error) in atelet, ateapi, ateom-gvisor, and ateom-microvm. Defaults to info — no behavior change unless the flag is set. Groundwork for demoting per-item GC log lines to Debug (agent-substrate#463 Phase 2 observability): once this lands, chatty diagnostic lines can ship at Debug and still be enabled per-node when needed. ateom-gvisor builds its own handler (shared synced writer); it honors the same level via serverboot.LogLevel().
Kind installs are dev/CI; debug there lets e2e suites assert on per-item log lines while production installs keep the info default.
…, default-is-info test - atenet's router and dns subcommands had their own --log-level with a hand-rolled switch that silently fell back to info on a bad value; both now go through serverboot.SetLogLevel, so an invalid value is an error everywhere the flag exists. Empty string is documented as unset (no-op) — programmatic configs that never set the field keep the default. - LogLevel() returns slog.Leveler instead of *slog.LevelVar, keeping SetLogLevel the only mutation path. - Test pins the untouched default at exactly info, and the empty-string no-op. Note on the ateom binaries: they accept --log-level but their container args are constructed by the WorkerPool controller (workerpool_apply.go) with no pass-through, so the flag is unreachable there until a follow-up wires it. That wiring must roll out only after this change's ateom images are deployed — older images reject unknown flags and would crashloop.
Replaces the duplicated handler construction and picks up the contextlogging wrapper, so atenet log lines carry ate.dev/trace-id like the other binaries — the router initializes tracing right after this point, so span IDs now correlate with logs.
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.
Adds a dynamic
--log-levelflag (debug, info, warn, error; case-insensitive) tothe server binaries, backed by a
slog.LevelVarinserverboot. Defaults toinfo— no behavior change unless the flag is set.InitLogger's handler;SetLogLevel(string)to parse and set it (empty string = unset, a documented no-op);
LogLevel()returns a
slog.Levelerfor binaries that build their own handler.container args are built by the WorkerPool controller with no pass-through yet,
so wiring it is a follow-up — and that follow-up must roll out only after this
change's ateom images are deployed (older images reject unknown flags and would
crashloop).
--log-levelparsers that silently fell back to
infoon a bad value; both now useserverboot.SetLogLevelandserverboot.InitLogger, which also addsate.dev/trace-idcorrelation to atenet logs.--log-level=debugon kind (dev/CI), so e2esuites can assert on per-item log lines; production installs keep
info.Motivation: groundwork for #463 Phase 2 observability — per-item GC log lines can
ship at Debug and be enabled per-node instead of landing at Info.
Testing: unit tests pin the untouched default at exactly
info, dynamicraise/lower, case-insensitivity, invalid-value rejection, and the empty-string
no-op;
go test -racegreen across serverboot, atenet, atelet, ateapi.