Skip to content

fix(logging): downgrade replica sync messages from INFO to DEBUG#1207

Open
corylanou wants to merge 1 commit intomainfrom
issue-1203-replica-sync-logging-at-info-level
Open

fix(logging): downgrade replica sync messages from INFO to DEBUG#1207
corylanou wants to merge 1 commit intomainfrom
issue-1203-replica-sync-logging-at-info-level

Conversation

@corylanou
Copy link
Copy Markdown
Collaborator

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 upload

These 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 cleanly
  • go test -race ./... — all tests pass (including TestReplica_ContextCancellationNoLogs which asserts on these log messages, using a DEBUG-level logger)
  • golangci-lint run — no new lint issues

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project (go fmt, go vet)
  • I have tested my changes (go test ./...)
  • I have updated the documentation accordingly (if needed)

"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.
@github-actions
Copy link
Copy Markdown

PR Build Metrics

All clear — no issues detected

Check Status Summary
Binary size 35.91 MB (0.0 KB / 0.00%)
Dependencies No changes
Vulnerabilities None detected
Go toolchain 1.25.8 (latest)
Module graph 1204 edges (0)

Binary Size

Size Change
Base (ae88b16) 35.91 MB
PR (34099bf) 35.91 MB 0.0 KB (0.00%)

Dependency Changes

No dependency changes.

govulncheck Output

No vulnerabilities found.

Build Info

Metric Value
Build time 41s
Go version go1.25.8
Commit 34099bf

🤖 Updated on each push.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread replica.go
}

r.Logger().Info("replica sync",
r.Logger().Debug("replica sync",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replica sync logging at INFO level

1 participant