fix(logging): downgrade replica sync messages from INFO to DEBUG#1207
fix(logging): downgrade replica sync messages from INFO to DEBUG#1207
Conversation
"replica sync" and "ltx file uploaded" are logged every sync interval (1s-5s), flooding logs with routine operational noise. Moving these to DEBUG keeps INFO clean while preserving visibility at debug level.
PR Build Metrics✅ All clear — no issues detected
Binary Size
Dependency ChangesNo dependency changes. govulncheck OutputBuild Info
🤖 Updated on each push. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cf036834f0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| r.Logger().Info("replica sync", | ||
| r.Logger().Debug("replica sync", |
There was a problem hiding this comment.
Keep replica sync visible at the default INFO level
In the default litestream replicate setup the logger stays at INFO (cmd/litestream/main.go:80, cmd/litestream/replicate.go:113) and the control socket is disabled by default (server.go:24-30), so downgrading both replica sync and ltx file uploaded to DEBUG removes the only built-in signal that healthy remote replication is advancing. litestream status still tells users to “check logs” for replica TXID/sync status (cmd/litestream/status.go:142-143), but after this change a normally functioning replica is silent until an error occurs, which makes it much harder to confirm progress or diagnose a stall in production.
Useful? React with 👍 / 👎.
Description
Downgrade two high-frequency log messages from INFO to DEBUG level:
"replica sync"— logged every sync interval (1s-5s)"ltx file uploaded"— logged on every LTX file uploadThese are routine operational messages that flood logs at INFO level. The
"replica sync recovered"message remains at INFO since it signals a meaningful state change.Motivation and Context
Users running Litestream with default logging see hundreds of identical
"replica sync"lines per minute, making it hard to spot meaningful events.Fixes #1203
How Has This Been Tested?
go build ./...— compiles cleanlygo test -race ./...— all tests pass (includingTestReplica_ContextCancellationNoLogswhich asserts on these log messages, using a DEBUG-level logger)golangci-lint run— no new lint issuesTypes of changes
Checklist
go fmt,go vet)go test ./...)