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 |
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.).
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"