Skip to content

Rust library to have logging work with Java's log4j

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Better-Player/log4j-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

log4j-rs

Crates.io
This crate allows a Rust developer to easily log to Java's Log4j from Rust.

Usage

use log4j::{JavaLogger, LogLevel};

// Create a logger
// This assumes that com.example.Example has an appender in the Java log4j configuration.
// `&env` is a reference to jni::JNIENv
let logger = JavaLogger::new(&env, "com.example.Example").expect("Failed to create JavaLogger");

// Now for the actual logging
logger.log(LogLevel::Error, "Error!").expect("Failed to log to ERROR level");
logger.log(LogLevel::Warn, "Warn!").expect("Failed to log to WARN level");
logger.log(LogLevel::Info, "Info!").expect("Failed to log to INFO level");
logger.log(LogLevel::Debug, "Debug!").expect("Failed to log to DEBUG level");

License

log4j-rs is dual licensed under the Apache-2.0 and MIT license, at your discretion

About

Rust library to have logging work with Java's log4j

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages