Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork160
A highly configurable logging framework for Rust
License
Apache-2.0, MIT licenses found
Licenses found
estk/log4rs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
log4rs is a highly configurable logging framework modeled after Java's Logbackand log4j libraries.
log4rs.yaml:
refresh_rate:30 secondsappenders:stdout:kind:consolerequests:kind:filepath:"log/requests.log"encoder:pattern:"{d} - {m}{n}"root:level:warnappenders: -stdoutloggers:app::backend::db:level:infoapp::requests:level:infoappenders: -requestsadditive:false
lib.rs:
use log::{error, info, warn};use log4rs;fnmain(){ log4rs::init_file("config/log4rs.yaml",Default::default()).unwrap();info!("booting up");// ...}
1.75
- Run the tests:
cargo test --all-features
- Run the tests for windows withcross:
cross test --target x86_64-pc-windows-gnu
- Run the tests for all individual features:
./test.sh
- Run the tests for all individual features for windows withcross:
./test.sh win
If you are using the file rotation in your configuration there is a knownsubstantial performance issue with either thegzip
orzstd
features. When rolling files it will zip log archives automatically. This isa problem when the log archives are large as the zip process occurs inthe main thread and will halt the process until the zip processcompletes.
The methods to mitigate this are as follows.
- Use the
background_rotation
feature which spawns an os thread to do the compression. - Do not enable the
gzip
nor thezstd
features. - Ensure the archives are small enough that the compression time is acceptable.
For more information see the PR that addedbackground_rotation
.
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE orhttp://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT orhttp://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submittedfor inclusion in the work by you shall be dual licensed as above, without anyadditional terms or conditions.
About
A highly configurable logging framework for Rust
Topics
Resources
License
Apache-2.0, MIT licenses found
Licenses found
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.