/ Published in: Java
This snippet shows how to get access to the underlying log4j logger when using apache commons logging.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
if(logger instanceof Log4JLogger) { Log4JLogger log4j = (Log4JLogger)logger; Logger underlyingLogger = log4j.getLogger(); underlyingLogger.setLevel(Level.INFO); underlyingLogger.addAppender(new ConsoleAppender( new PatternLayout("%-5p [%t]: %m%n"))); }