Module log4rs::file

source · []
Expand description

Support for log4rs configuration from files.

Multiple file formats are supported, each requiring a Cargo feature to be enabled. YAML support requires the yaml_format feature, JSON support requires the json_format feature, and TOML support requires the toml_format feature.

Syntax

All file formats currently share the same structure. The example below is of the YAML format.

refresh_rate: 30 seconds

appenders:

  foo:

    kind: console

    filters:

      -
        kind: threshold

        level: error

    encoder:

      kind: pattern

      pattern: "{d} [{t}] {m}{n}"

root:

  level: warn

  appenders:
    - foo

loggers:

  foo::bar::baz:

    level: trace

    appenders:
      - foo

    Default: true
    additive: false

Structs

A container of Deserializers.

An error deserializing a configuration into a log4rs Config.

A raw deserializable log4rs configuration.

Traits

A trait implemented by traits which are deserializable.

A trait for objects that can deserialize log4rs components out of a config.