Module log4rs::encode::json [] [src]

An encoder which writes a JSON object.

Each log event will be written as a JSON object on its own line.

Requires the json_encoder feature.

Contents

An example object (note that real output will not be pretty-printed):

{
    "time": "2016-03-20T14:22:20.644420340-08:00",
    "message": "the log message",
    "module_path": "foo::bar",
    "file": "foo/bar/mod.rs",
    "line": 100,
    "level": "INFO",
    "target": "foo::bar",
    "thread": "main",
    "mdc": {
        "request_id": "123e4567-e89b-12d3-a456-426655440000"
    }
}

Structs

JsonEncoder

An Encoder which writes a JSON object.

JsonEncoderConfig

The JSON encoder's configuration

JsonEncoderDeserializer

A deserializer for the JsonEncoder.