Logging
The Core includes logging services to give you visibility into your application's operations.
Log format
Configure how logs are output using app.traceJson:
falseoutputs plaintext logs for human readability during local developmenttrueoutputs JSON-formatted logs for machine parsing in production environments
Log levels
From most to least verbose:
| Level | Description |
|---|---|
trace | Verbose debugging with all technical details. |
debug | Standard debugging information. |
info | Normal operational messages. |
warn | Potential issues that don't require immediate action. |
error | Critical errors requiring intervention. |
Each level automatically includes all less-verbose levels. Setting info
will show info, warn, and error messages while filtering out trace and
debug.
Never use trace in production. This level logs sensitive data including
secrets.
Filtering logs
Use app.traceLevel to control which messages appear.
Set a level as a string to apply it globally across your entire application:
app:
traceLevel: "info"
Name a specific Rust crate to override the global level for that crate:
app:
traceLevel: "info,hyper=debug"
Do not add a space between comma-separated items.
Target a module within a crate using :: notation to set the most granular
level:
app:
traceLevel: "info,hyper=debug,sqlx::query=error"
More specific scopes override broader ones. In the example above, most logs
appear at info level, hyper crate logs appear at debug, and only
errors from sqlx::query appear.
Working with log levels
The Core includes many crates and modules. This section provides practical guidance for common scenarios.
General development
For day-to-day local development:
app:
traceLevel: "info"
This provides operational visibility such as server starts, request completions, database request and change summaries, and errors caused by clients, without overwhelming detail.
Debugging issues
When troubleshooting, follow this progression:
Identify the source: If you see an error, the log line indicates which crate or module it originates from
Increase verbosity temporarily: If the source is not obvious, lower the global level to
debugortraceto see more detailTarget the component: Once you have identified the relevant crate or module, remove the global setting and increase verbosity only for that component
Production
Use info or warn globally in production. Never use trace as it logs
sensitive data including secrets.