log4rs
log4rs is a highly configurable logging framework modeled after Java's Logback and log4j libraries.
log4rs.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:
use ;
use log4rs;
Rust Version Requirements
Since version 0.10.0
the minimum version for rust is 1.38.0
and is verified via CI.
1.38.0
is required for windows due to the backtrace crate.
1.34.0
may work for unix environments although it is not officially supported.
Building for Dev
- Run the tests:
cargo test --all-features
- Run the tests for windows with cross:
cross test --target x86_64-pc-windows-gn
- Run the tests for all individual features:
./test.sh
- Run the tests for all individual features for windows with cross:
./test.sh win
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (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.