Ask Basic Configurator in Apache Commong Log

Posted by adisembiring on Stack Overflow See other posts from Stack Overflow or by adisembiring
Published on 2010-05-24T04:49:23Z Indexed on 2010/05/24 5:10 UTC
Read the original article Hit count: 350

I use log4j as logger for my web application. in log4j, I can set the level log in log4j properties or log4j.xml. in log4j, we instance logger as follows:

static Logger logger = Logger.getLogger(SomeClass.class);

I init log4j basic configurator in a servlet file using init method. But, I usually test application using JUnit, So I init the basic configurator in setup method. after that, I test the application, and I can see the log.

Because I deployed, the web in websphere. I change all of logging instance become:

private Log log = LogFactory.getLog(Foo.class);

I don't know how to load basic configurator using ACL. so I can't control debug level to my JUnit test.

do you have any suggestion, without changing

static Logger logger = Logger.getLogger(SomeClass.class); 

become

static Logger logger = Logger.getLogger(SomeClass.class);

© Stack Overflow or respective owner

Related posts about java

Related posts about logging