JDK LogManager implementations for Log4j, Log4j2 and Logback. Alternative to SLF4JBridgeHandler.
APACHE-2.0 License
JDK LogManager implementations for Log4j, Log4j2, Logback and servlet containers.
My favorite Framework Jersey (JAX-RS 2.0) uses JDK logging. There are some disadvantages with JDK Logging:
This project allows you to redirect JDK logging to Log4j (1.x or 2.x) or Logback without performance costs. Configuration changes are immediately noticed by the JDK logging wrapper. The JDK LogManager and Logger are completely replaced.
The Jersey Grizzly HTTP server (jersey-container-grizzly2-http) works fine with all wrapper implementations.
Set system property in main method:
System.setProperty( "java.util.logging.manager", JulLogManager.class.getName() );
Set system property on command line:
java -Djava.util.logging.manager=com.github.schnitker.logmgr.log4j.JulLogManager
Note that the JDK LogManager does not work well with servlet containers.
There is an context class loader friendly implementation in the module 'logmgr-factory'. The factory searches through the Java ServiceLoader for an implementation of com.github.schnitker.logmgr.JulLoggerFactory. The module 'logmgr-factory' must be added to the bootstrap libraries and the system property java.util.logging.manager must be set.
Every web application instance can contain one logging wrapper.
Current artifacts:
Log4j 1.x implementation:
'com.github.schnitker.logmanager:logmgr-log4j:1.0.2'
Log4j 2.x implementation:
'com.github.schnitker.logmanager:logmgr-log4j2:1.0.2'
Logback implementation:
'com.github.schnitker.logmanager:logmgr-logback:1.0.2'
Servlet container implementation:
'com.github.schnitker.logmanager:logmgr-factory:1.0.2'
The project uses the gradle build system.
Eclipse Setup: Run the command 'gradlew eclipse' or 'gradlew cleanEclipse eclipse'.
Building artifacts: Call 'gradlew assemble'.