Skip to content

Commit 05dec1a

Browse files
committed
feat: add top-level section on stdout
1 parent 1cde06a commit 05dec1a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

configuration/logs.mdx

+5-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ title: "Logs"
33
description: "Tracing or logging in Shuttle apps."
44
---
55

6-
When you build an app with Shuttle, a global subscriber will be created and installed behind the scenes. If you'd rather set up
6+
Shuttle will record anything your application writes to `stdout`, e.g. a `tracing` or `log` crate configured to write to `stdout`,
7+
or simply `println!`. By default, Shuttle will set up a global tracing subscriber behind the scenes. If you'd rather set up
78
your own tracing or logging, you can opt-out of the default subscriber by disabling the default features on `shuttle-runtime`:
89

910
`shuttle-runtime = { version = "*", default-features = false }`
@@ -34,7 +35,8 @@ in your project is add it to your `Cargo.toml`.
3435

3536
### Configuring the default subscriber
3637

37-
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="<crate-name>=trace" cargo shuttle run`.
38+
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
39+
log level for local runs with `RUST_LOG="<crate-name>=trace" cargo shuttle run`.
3840

3941
We do not currently allow changing the log level for deployments. Deployments use `RUST_LOG=debug,shuttle=trace,h2=warn` at the moment.
4042

@@ -44,7 +46,7 @@ If you opt-out of the default subscriber, you can set up logging or tracing the
4446
The only thing you need to ensure is that your setup writes to `stdout`, as this is what Shuttle will record and return from
4547
the `cargo shuttle logs` commands.
4648

47-
We've created an example Axum app with a simple `tracing` setup here: TODO: update this link: https://github.com/shuttle-hq/shuttle-examples/pull/84.
49+
We've created an example Axum app with a simple `tracing`: [custom tracing example](https://github.com/shuttle-hq/shuttle-examples/tree/main/tracing/custom-tracing-subscriber).
4850

4951
## Viewing Logs
5052

0 commit comments

Comments
 (0)