Shuttle records build logs and anything your application writes to stdout and stderr.

Viewing Logs

To view the logs for your current active deployment, if there is one:

shuttle logs

You can also view logs of a specific deployment by adding the deployment id to this command:

shuttle logs <id>

To get the deployment ID, you can run this command to view your deployment history:

shuttle deployment list

The --latest or -l flag will get the logs from the most recently created deployment:

shuttle logs --latest

To view logs without the timestamps and log origin tags:

shuttle logs --raw

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 on shuttle-runtime:

Cargo.toml
shuttle-runtime = { version = "0.48.0", default-features = false }

With the default features enabled you can skip the step of initializing your subscriber when implementing tracing in your application, all you have to do is add tracing as a dependency in your Cargo.toml, and you’re good to go!

use tracing::info;

#[shuttle_runtime::main]
async fn main() -> ... {
    info!("Starting up");

    // ...
}

If you’d rather use log, everything from the above section on tracing applies. A log-compatible layer is added to the global subscriber, so like with tracing, all you need to do to use log macros in your project is add it to your Cargo.toml.

Configuring the default subscriber

The global subscriber has an env_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 to stdout, 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.