How to use SLF4J Log4jLoggerAdapter

Posted by David Wong on Stack Overflow See other posts from Stack Overflow or by David Wong
Published on 2011-01-17T09:50:23Z Indexed on 2011/01/17 9:53 UTC
Read the original article Hit count: 355

Filed under:
|
|

I'm deploying an enterprise application on Weblogic 8.1 which has log4j 1.2.8 on it's classpath. I'm getting the following error with SLF4J 1.6.1:

SLF4J versions 1.4.0 and later requires log4j 1.2.12 or later

http://www.slf4j.org/codes.html#log4j_version

Above link recommends using Log4jLoggerAdapter.

I've changed

Logger logger = LoggerFactory.getLogger(HelloWorld.class);
logger.info("Hello World");

to

Log4jLoggerAdapter logger = (Log4jLoggerAdapter) LoggerFactory.getLogger(HelloWorld.class);
logger.info("Hello World");

However, I'm still encountering the error. Any advice on how to correctly implement this?

Thanks

© Stack Overflow or respective owner

Related posts about java-ee

Related posts about log4j