You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Chandrasekaran.V" <ch...@wisorindia.soft.net> on 2003/04/12 21:16:49 UTC

Help in getting commons and log4j to work together

Hi,
We are planning to use log4j in our project. To have a common interface we
are planning
on using commons logging as a wrapper.

The problem I am facing is this.

Example.class

Log log = LogFactory.getLog(Example.class);
log.info("log.isDebugEnabled()"+log.isDebugEnabled());
log.info("Test info message");
log.warn("Test warn message");
log.error("Test error message");
log.debug("Test debug message");

And my commoms-logging.properties has the following entry
org.apache.commons.logging.Log = org.apache.commons.logging.impl.Log4JLogger

The issue is when I run this code my Debug messages are not printed. How do
I make them
print. Do I have to configure something in the log4j.properties file? Or is
there any way
I can do it in commons-logging.properties file.




Thanks in Advance
Chandrav




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Help in getting commons and log4j to work together

Posted by Jacob Kjome <ho...@visi.com>.
If you are looking for advice about using commons-logging, the only answer 
you will get on this list is to dump it and use log4j directly.  Ask 
yourself what you are gaining by using this wrapper and read..

http://www.qos.ch/logging/thinkAgain.html

Jake

At 12:16 PM 4/12/2003 -0700, you wrote:
>Hi,
>We are planning to use log4j in our project. To have a common interface we
>are planning
>on using commons logging as a wrapper.
>
>The problem I am facing is this.
>
>Example.class
>
>Log log = LogFactory.getLog(Example.class);
>log.info("log.isDebugEnabled()"+log.isDebugEnabled());
>log.info("Test info message");
>log.warn("Test warn message");
>log.error("Test error message");
>log.debug("Test debug message");
>
>And my commoms-logging.properties has the following entry
>org.apache.commons.logging.Log = org.apache.commons.logging.impl.Log4JLogger
>
>The issue is when I run this code my Debug messages are not printed. How do
>I make them
>print. Do I have to configure something in the log4j.properties file? Or is
>there any way
>I can do it in commons-logging.properties file.
>
>
>
>
>Thanks in Advance
>Chandrav
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: log4j-user-help@jakarta.apache.org