Skip to main content

Logging Configuration

The [logging] section controls PRISM's log output level and format.

TOML Example

[logging]
level = "info"
format = "pretty"

Parameters

ParameterTypeDefaultDescription
levelString"info"Log verbosity: trace, debug, info, warn, error
formatString"pretty"Output format: pretty or json

Detailed Explanation

level

Controls the minimum severity of log messages emitted:

LevelDescription
traceMost verbose. Includes internal state transitions, every request detail
debugDetailed diagnostic information, useful for troubleshooting
infoGeneral operational messages: startup, render completions, cache hits/misses
warnUnexpected situations that are handled gracefully
errorFailures 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"