Skip to content

Commit 33ff87c

Browse files
fix(logging): flatten structured fields in JSON log output
tracing-subscriber's .json() nests event fields under a "fields" subobject by default, making the structured data awkward to query downstream. Enable flatten_event so fields live at the top level. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7704759 commit 33ff87c

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ async fn main() -> Result<()> {
373373
.with_env_filter(env_filter)
374374
.with_target(false)
375375
.json()
376+
.flatten_event(true)
376377
.init(),
377378
LogFormat::Text => fmt().with_env_filter(env_filter).with_target(false).init(),
378379
}

0 commit comments

Comments
 (0)