Logging Configuration
The [logging] section controls PRISM's log output level and format.
TOML Example
[logging]
level = "info"
format = "pretty"
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
level | String | "info" | Log verbosity: trace, debug, info, warn, error |
format | String | "pretty" | Output format: pretty or json |
proxied_requests | Boolean | true | Log the line for each visitor request proxied to the origin at info. false logs it at debug |
Detailed Explanation
level
Controls the minimum severity of log messages emitted:
| Level | Description |
|---|---|
trace | Most verbose. Includes internal state transitions, every request detail |
debug | Detailed diagnostic information, useful for troubleshooting |
info | General operational messages: startup, render completions, cache hits/misses |
warn | Unexpected situations that are handled gracefully |
error | Failures that require attention |
format
pretty(default): Human-readable, colorized output. Best for development and interactive use.json: Structured JSON output, one object per line. Best for production log aggregation systems (Datadog, Elasticsearch, CloudWatch, etc.).
Request log lines
At info level PRISM logs one request line per request. On the line for a request proxied straight to the origin (cache = "BYPASS"), the path field holds the path only: the query string is left out, because visitors' queries can carry reset tokens, session identifiers and search terms.
Set proxied_requests = false to log the proxied-request lines at debug instead. On a busy site those lines are most of the log. Lines for rendered responses, fallbacks and errors keep their levels, and level = "debug" brings the proxied lines back.
RUST_LOG environment variable
The RUST_LOG environment variable overrides the configured level. This is useful for temporary debugging without changing the config file:
RUST_LOG=debug prism -c /etc/prism/config.toml
You can also target specific modules:
RUST_LOG=prism::render=trace,prism::cache=debug prism -c /etc/prism/config.toml
PRISM uses the tracing crate for structured logging, so all standard RUST_LOG directives are supported.
Example Use Cases
Production with JSON logs
[logging]
level = "info"
format = "json"
Debugging render issues
[logging]
level = "debug"
format = "pretty"
Quiet mode (errors only)
[logging]
level = "error"
format = "json"