log4rs 0.3.0

A highly configurable multi-output logging implementation for the `log` facade
docs.rs failed to build log4rs-0.3.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: log4rs-1.3.0

log4rs

Build Status

Documentation is available at https://sfackler.github.io/log4rs/doc/log4rs

log4rs is a highly configurable logging framework modeled after Java's Logback and log4j libraries.

log.toml:

# Scan this file for changes every 30 seconds
refresh_rate = 30

# An appender named "stdout" that writes to stdout
[appender.stdout]
kind = "console"

# An appender named "requests" that writes to a file with a custom pattern
[appender.requests]
kind = "file"
path = "log/requests.log"
pattern = "%d - %m"

# Set the default logging level to "warn" and attach the "stdout" appender to the root
[root]
level = "warn"
appenders = ["stdout"]

# Raise the maximum log level for events sent to the "app::backend::db" logger to "info"
[[logger]]
name = "app::backend::db"
level = "info"

# Route log events sent to the "app::requests" logger to the "requests" appender,
# and *not* the normal appenders installed at the root
[[logger]]
name = "app::requests"
level = "info"
appenders = ["requests"]
additive = false

lib.rs:

#[macro_use]
extern crate log;
extern crate log4rs;

use std::default::Default;

fn main() {
    log4rs::init_file("config/log.toml", Default::default()).unwrap();

    info!("booting up");

    ...
}