You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: configuration/logs.mdx
+5-3
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,8 @@ title: "Logs"
3
3
description: "Tracing or logging in Shuttle apps."
4
4
---
5
5
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
7
8
your own tracing or logging, you can opt-out of the default subscriber by disabling the default features on `shuttle-runtime`:
8
9
9
10
`shuttle-runtime = { version = "*", default-features = false }`
@@ -34,7 +35,8 @@ in your project is add it to your `Cargo.toml`.
34
35
35
36
### Configuring the default subscriber
36
37
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`.
38
40
39
41
We do not currently allow changing the log level for deployments. Deployments use `RUST_LOG=debug,shuttle=trace,h2=warn` at the moment.
40
42
@@ -44,7 +46,7 @@ If you opt-out of the default subscriber, you can set up logging or tracing the
44
46
The only thing you need to ensure is that your setup writes to `stdout`, as this is what Shuttle will record and return from
45
47
the `cargo shuttle logs` commands.
46
48
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).
0 commit comments