Skip to content

Commit

Permalink
use json format for structured logging (#102)
Browse files Browse the repository at this point in the history
- use json formatter for logs instead of compact (text)
  • Loading branch information
wagpa committed Apr 29, 2024
1 parent da96045 commit ccdb6d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ prometheus = { version = "0.13" }
futures-util = "0.3.30"
config = "0.14.0"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
tracing-subscriber = { version = "0.3.18", features = ["json"] }
sentry = { version = "0.32.2", default-features = false, features = ["backtrace", "contexts", "panic", "debug-images", "reqwest", "rustls", "tower"] }
sentry-tracing = "0.32.2"
moka = { version = "0.12.5", features = ["future"] }
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing_subscriber::registry()
.with(
tracing_subscriber::fmt::layer()
.compact()
.json()
.with_filter(settings.logging.level),
)
.with(sentry_tracing::layer())
Expand Down

0 comments on commit ccdb6d6

Please sign in to comment.