tracing-flat-json

Crates.iotracing-flat-json
lib.rstracing-flat-json
version0.1.0
created_at2025-10-26 23:33:40.268467+00
updated_at2025-10-26 23:33:40.268467+00
descriptionA simple tracing-subscriber Layer emitting newline-delimited JSON.
homepage
repositoryhttps://github.com/PeterFaiman/tracing-flat-json
max_upload_size
id1902019
size89,470
Peter Faiman (PeterFaiman)

documentation

README

tracing-flat-json

to combining the json-subscriber options with_flattened_event and with_top_level_flattened_span_list, without the caveats about duplicate fields noted in the documentation for those options.

Usage

use tracing_subscriber::prelude::*;

tracing_subscriber::Registry::default()
    .with(tracing_flat_json::FlatJsonLayer::new(std::io::stdout))
    .init();

Feature Flags

Output Format

Included:

  • timestamp (RFC3339 UTC)
  • level
  • trace_id (with feature tracing-opentelemetry)
  • code.file.path
  • code.line.number
  • event message
  • event fields, source code order
  • parent span fields, source code order, latest span first, root span last

Excluded:

  • span names
  • target
  • span_id
  • duplicate fields (only latest value for each field name)
Commit count: 0

cargo fmt