All Projects → estk → Log4rs

estk / Log4rs

Licence: other
A highly configurable logging framework for Rust

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Log4rs

Co
Art of C++. Flag, logging, unit-test, json, go-style coroutine and more.
Stars: ✭ 2,264 (+368.74%)
Mutual labels:  json, logging, log
Logger json
JSON console backend for Elixir Logger.
Stars: ✭ 108 (-77.64%)
Mutual labels:  json, logging, log
Poco
The POCO C++ Libraries are powerful cross-platform C++ libraries for building network- and internet-based applications that run on desktop, server, mobile, IoT, and embedded systems.
Stars: ✭ 5,762 (+1092.96%)
Mutual labels:  json, xml, logging
Xlog
Android logger, pretty, powerful and flexible, log to everywhere, save to file, all you want is here.
Stars: ✭ 2,468 (+410.97%)
Mutual labels:  json, xml, log
Cppwebframework
​The C++ Web Framework (CWF) is a MVC web framework, Open Source, under MIT License, using C++ with Qt to be used in the development of web applications.
Stars: ✭ 348 (-27.95%)
Mutual labels:  json, xml
Wiremock
A tool for mocking HTTP services
Stars: ✭ 4,790 (+891.72%)
Mutual labels:  json, xml
Iguana
universal serialization engine
Stars: ✭ 481 (-0.41%)
Mutual labels:  json, xml
Cocoadebug
iOS Debugging Tool 🚀
Stars: ✭ 3,769 (+680.33%)
Mutual labels:  logging, log
Daiquiri
Python library to easily setup basic logging functionality
Stars: ✭ 308 (-36.23%)
Mutual labels:  logging, log
Hashover Next
This branch will be HashOver 2.0
Stars: ✭ 353 (-26.92%)
Mutual labels:  json, xml
Node Rest Client
REST API client from node.js
Stars: ✭ 365 (-24.43%)
Mutual labels:  json, xml
Xidel
Command line tool to download and extract data from HTML/XML pages or JSON-APIs, using CSS, XPath 3.0, XQuery 3.0, JSONiq or pattern matching. It can also create new or transformed XML/HTML/JSON documents.
Stars: ✭ 335 (-30.64%)
Mutual labels:  json, xml
Underscore Java
java port of Underscore.js
Stars: ✭ 327 (-32.3%)
Mutual labels:  json, xml
Log
Structured Logging Made Easy
Stars: ✭ 350 (-27.54%)
Mutual labels:  json, logging
Tslog
📝 tslog - Expressive TypeScript Logger for Node.js.
Stars: ✭ 321 (-33.54%)
Mutual labels:  json, logging
Tbox
🎁 A glib-like multi-platform c library
Stars: ✭ 3,800 (+686.75%)
Mutual labels:  json, xml
Stream Parser
⚡ PHP7 / Laravel Multi-format Streaming Parser
Stars: ✭ 391 (-19.05%)
Mutual labels:  json, xml
Cutelog
GUI for logging
Stars: ✭ 386 (-20.08%)
Mutual labels:  logging, log
Dog Ceo Api
The API hosted at dog.ceo
Stars: ✭ 393 (-18.63%)
Mutual labels:  json, xml
Logstash Logger
Ruby logger that writes logstash events
Stars: ✭ 442 (-8.49%)
Mutual labels:  json, logging

log4rs

docs crates.io License: MIT OR Apache-2.0 CI Minimum rustc version

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

Warning

If you are using the file rotation in your configuration there is a known substantial performance issue so listen up! By default the gzip feature is enabled and when rolling files it will zip log archives automatically. This is a problem when the log archives are large as the zip happens in the main thread and will halt the process while the zip is completed. Be advised that the gzip feature will be removed from default features as of 1.0.

The methods to mitigate this are as follows.

  1. Use the background_rotation feature which spawns an os thread to do the compression.
  2. Disable the gzip feature with --no-default-features.
  3. Ensure the archives are small enough that the compression time is acceptable.

For more information see the PR that added background_rotation.

Quick Start

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 log::{error, info, warn};
use log4rs;

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

    info!("booting up");

    // ...
}

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

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].