pub struct Json { /* private fields */ }
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_event
can be used to enable flattening event fields into the rootJson::with_current_span
can be used to control logging of the current spanJson::with_span_list
can 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 Json
impl UnwindSafe for Json
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more