stdout and stderr.
Viewing Logs
To view the logs for your current active deployment, if there is one:--latest or -l flag will get the logs from the most recently created deployment:
Default Tracing Subscriber
By default, Shuttle will set up a global tracing subscriber behind the scenes. If you’d rather set up your own tracing or logging, you can opt-out by disabling the default features onshuttle-runtime:
Cargo.toml
tracing as a dependency in your Cargo.toml, and you’re good to go!
log macros
in your project is add it to your Cargo.toml.
Configuring the default subscriber
The global subscriber has anenv_filter which defaults to the INFO log level if no RUST_LOG variable is set.
You can change the log level for local runs with RUST_LOG="..." shuttle run or shuttle run --debug.
Deployments use RUST_LOG="info", and this is not configurable at the moment. A custom subscriber can be set up instead.
Custom logging setup
If you opt-out of the default subscriber, you can set up logging or tracing the way you would in any other Rust application. The only thing you need to ensure is that your setup writes tostdout, as this is what Shuttle will record and return from
the shuttle logs commands.
We’ve created an example Actix Web app with a simple tracing: custom tracing example.
