Skip to content

Logging

Walsync uses the standard Rust RUST_LOG environment variable for log configuration.

LevelDescription
errorOnly errors
warnWarnings and errors
infoNormal operation (default)
debugDetailed debugging
traceVery verbose, includes all internal details
Terminal window
# Default: info level
export RUST_LOG=walsync=info
# Debug logging
export RUST_LOG=walsync=debug
# Trace logging (very verbose)
export RUST_LOG=walsync=trace
# Errors only
export RUST_LOG=walsync=error

Include AWS SDK logs for debugging S3 issues:

Terminal window
# Debug walsync + AWS config
export RUST_LOG=walsync=debug,aws_config=debug
# Debug all AWS SDK components
export RUST_LOG=walsync=debug,aws_sdk_s3=debug,aws_config=debug
# Trace everything (very verbose)
export RUST_LOG=trace
2024-01-15T10:30:00Z INFO walsync: Watching 3 database(s)
2024-01-15T10:30:05Z INFO walsync: app.db: WAL sync (4 frames, 16KB)
2024-01-15T11:30:00Z INFO walsync: app.db: Scheduled snapshot complete
2024-01-15T10:30:00Z INFO walsync: Watching 3 database(s)
2024-01-15T10:30:00Z DEBUG walsync: Connecting to S3 endpoint: https://fly.storage.tigris.dev
2024-01-15T10:30:01Z DEBUG walsync: S3 connection established
2024-01-15T10:30:05Z DEBUG walsync: app.db: Detected WAL change, reading frames
2024-01-15T10:30:05Z DEBUG walsync: app.db: Read 4 frames (16384 bytes)
2024-01-15T10:30:05Z DEBUG walsync: app.db: Computing SHA256 checksum
2024-01-15T10:30:05Z INFO walsync: app.db: WAL sync (4 frames, 16KB)
[Service]
Environment=RUST_LOG=walsync=info

View logs:

Terminal window
sudo journalctl -u walsync -f
environment:
RUST_LOG: walsync=info

View logs:

Terminal window
docker logs -f walsync

For log aggregation systems, structured logging is available:

Terminal window
export RUST_LOG=walsync=info
export RUST_LOG_FORMAT=json # If supported

S3 connection issues:

Terminal window
RUST_LOG=walsync=debug,aws_config=debug walsync list --bucket my-bucket

Permission errors:

Terminal window
RUST_LOG=walsync=debug,aws_sdk_s3=debug walsync snapshot mydb.db --bucket my-bucket

WAL sync issues:

Terminal window
RUST_LOG=walsync=trace walsync watch mydb.db --bucket my-bucket