Struct tracing_subscriber::fmt::format::Json [−][src]
pub struct Json { /* fields omitted */ }This is supported on crate feature
fmt only.Expand description
Marker for Format that indicates that the verbose json log format should be used.
The full format includes fields from all entered spans.
Example Output
ⓘ
{
"timestamp":"Feb 20 11:28:15.096",
"level":"INFO",
"fields":{"message":"some message","key":"value"}
"target":"mycrate",
"span":{name":"leaf"},
"spans":[{"name":"root"},{"name":"leaf"}],
}Options
Json::flatten_eventcan be used to enable flattening event fields into the rootJson::with_current_spancan be used to control logging of the current spanJson::with_span_listcan be used to control logging of the span list object.
By default, event fields are not flattened, and both current span and span list are logged.
Implementations
If set to true event metadata will be flattened into the root object.
If set to false, formatted events won’t contain a field for the current span.
If set to false, formatted events won’t contain a list of all currently
entered spans. Spans are logged in a list from root to leaf.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Jsonimpl UnwindSafe for JsonBlanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span, returning an
Instrumented wrapper. Read more