# log4rs
log4rs is a highly configurable logging framework modeled after Java's Logback
and log4j libraries.
[![Build Status](https://travis-ci.org/sfackler/log4rs.svg?branch=master)](https://travis-ci.org/sfackler/log4rs)
[Documentation](https://docs.rs/log4rs)
log4rs.yaml:
```yaml
refresh_rate: 30 seconds
appenders:
stdout:
kind: console
requests:
kind: file
path: "log/requests.log"
encoder:
pattern: "{d} - {m}{n}"
root:
level: warn
appenders:
- stdout
loggers:
app::backend::db:
level: info
app::requests:
level: info
appenders:
- requests
additive: false
```
lib.rs:
```rust
#[macro_use]
extern crate log;
extern crate log4rs;
fn main() {
log4rs::init_file("config/log4rs.yaml", Default::default()).unwrap();
info!("booting up");
// ...
}
```
## License
Licensed under either of
* Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
### Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you shall be dual licensed as above, without any
additional terms or conditions.