Skip to content

Uses of default slog Logger instead of DB logger #1178

@hfoxy

Description

@hfoxy

Bug Description

Wouldn't really classify it as a bug, but there are a few usages of the default slog logger which feel like they should be configurable.

I can provide a PR for the "compaction complete" message (store.go line 783) but the others don't necessarily have access to a logger. It may be useful to allow the definition of a logger on the store which can be used.

Steps to Reproduce

  1. Define a logger with different styling on litestream.DB
  2. Open the store
  3. Make changes to the sqlite database
  4. See the difference in logs

Expected behavior:
"compaction complete" log message uses the slog logger defined in the database that is compacted.

Actual behavior:
Uses the slog default logger

Logs

Using defined logger

Mar  3 12:04:37.359 DBG litestream@v0.5.7/replica.go:187 ltx file uploaded component=litestream event=01KJSBW727VZQGTH0PM9A0ZP0K replica=s3 filename=/tmp/01KJSBW727VZQGTH0PM9A0ZP0K2782882974/.live-timing-event-01KJSBW727VZQGTH0PM9A0ZP0K.db-litestream/ltx/0/0000000000000053-0000000000000053.ltx minTXID=0000000000000053 maxTXID=0000000000000053

Using default slog logger

2026/03/03 12:04:40 INFO starting compaction monitor level=1 interval=10s
2026/03/03 12:04:40 INFO starting compaction monitor level=9 interval=24h0m0s
2026/03/03 12:04:40 INFO starting L0 retention monitor interval=15s retention=5m0s
2026/03/03 12:18:50 INFO compaction complete level=1 txid.min=000000000000002a txid.max=000000000000002b size=49247

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions