Expand description

json_env_logger is an extension of env_logger crate providing JSON formatted logs.

The env_logger is a crate that provides a way to declare what log levels are enabled for which modules \via a RUST_LOG env variable. See its documentation for syntax of declaring crate and module filtering options.


  • iso-timestamps

By default, a timestamp field called ts is emitted with the current unix epic timestamp in seconds You can replace this with IOS-8601 timestamps by enabling the iso-timestamps feature. Note, this will add chrono crate to your dependency tree.

json_env_logger = { version = "0.1", features = ["iso-timestamps"] }
  • backtrace

When registering a panic hook with panic_hook by default backtraces are omitted. You can annotate your error with then by enabling the backtrace feature.

json_env_logger = { version = "0.1", features = ["backtrace"] }


Yields the standard env_logger::Builder configured to log in JSON format

Register configured json env logger implementation with log crate.

Register a panic hook that serializes panic information as json and logs via log::error

Register configured json env logger with log crate