Logging
Walsync uses the standard Rust RUST_LOG environment variable for log configuration.
Log Levels
Section titled “Log Levels”| Level | Description |
|---|---|
error | Only errors |
warn | Warnings and errors |
info | Normal operation (default) |
debug | Detailed debugging |
trace | Very verbose, includes all internal details |
Basic Configuration
Section titled “Basic Configuration”# Default: info levelexport RUST_LOG=walsync=info
# Debug loggingexport RUST_LOG=walsync=debug
# Trace logging (very verbose)export RUST_LOG=walsync=trace
# Errors onlyexport RUST_LOG=walsync=errorAdvanced Filtering
Section titled “Advanced Filtering”Include AWS SDK logs for debugging S3 issues:
# Debug walsync + AWS configexport RUST_LOG=walsync=debug,aws_config=debug
# Debug all AWS SDK componentsexport RUST_LOG=walsync=debug,aws_sdk_s3=debug,aws_config=debug
# Trace everything (very verbose)export RUST_LOG=traceLog Output Examples
Section titled “Log Output Examples”Info Level (Default)
Section titled “Info Level (Default)”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 completeDebug Level
Section titled “Debug Level”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.dev2024-01-15T10:30:01Z DEBUG walsync: S3 connection established2024-01-15T10:30:05Z DEBUG walsync: app.db: Detected WAL change, reading frames2024-01-15T10:30:05Z DEBUG walsync: app.db: Read 4 frames (16384 bytes)2024-01-15T10:30:05Z DEBUG walsync: app.db: Computing SHA256 checksum2024-01-15T10:30:05Z INFO walsync: app.db: WAL sync (4 frames, 16KB)Production Logging
Section titled “Production Logging”systemd
Section titled “systemd”[Service]Environment=RUST_LOG=walsync=infoView logs:
sudo journalctl -u walsync -fDocker
Section titled “Docker”environment: RUST_LOG: walsync=infoView logs:
docker logs -f walsyncJSON Logging
Section titled “JSON Logging”For log aggregation systems, structured logging is available:
export RUST_LOG=walsync=infoexport RUST_LOG_FORMAT=json # If supportedTroubleshooting with Logs
Section titled “Troubleshooting with Logs”S3 connection issues:
RUST_LOG=walsync=debug,aws_config=debug walsync list --bucket my-bucketPermission errors:
RUST_LOG=walsync=debug,aws_sdk_s3=debug walsync snapshot mydb.db --bucket my-bucketWAL sync issues:
RUST_LOG=walsync=trace walsync watch mydb.db --bucket my-bucket