Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment Variables

All configuration is passed via environment variables. There are no config files.

Required

VariableDescription
DATABASE_URLPostgreSQL connection string, e.g. postgres://user:pass@host/stitchd

Optional

VariableDefaultDescription
HTTP_PORT8080Port for the REST Admin API
GRPC_PORT9090Port for the SDK gRPC sync server
APP_ENV(unset)Set to production to enable JSON structured logging
RUST_LOG(unset)Log level filter, e.g. info or info,stitchd_server=debug

Example .env

DATABASE_URL=postgres://stitchd:secret@localhost/stitchd
HTTP_PORT=8080
GRPC_PORT=9090
APP_ENV=production
RUST_LOG=info

Log Levels

RUST_LOG follows the tracing-subscriber directive format:

# All info, verbose for stitchd crates
RUST_LOG=info,stitchd_server=debug,stitchd_core=debug

# Quiet mode
RUST_LOG=warn

In production (APP_ENV=production) logs are emitted as JSON. In development they are printed in a human-readable format with colors.