logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Brown <Matt.Br...@citrixOnline.com>
Subject RE: Diff between Logger and Log
Date Wed, 30 Sep 2009 13:59:05 GMT
Log and LogFactory are not log4j classes (http://logging.apache.org/log4j/1.2/apidocs/index.html).

However they are both Commons Logging classes ( http://commons.apache.org/logging/commons-logging-1.1.1/apidocs/index.html
).

Are you using Commons Logging on accident?

Or are you trying to find out the differences between Commons Logging and Log4j? Take a look
at http://commons.apache.org/logging/commons-logging-1.1.1/guide.html.



-----Original Message-----
From: SkyMe [mailto:gs_vlad@mail.ru] 
Sent: Wednesday, September 30, 2009 8:03 AM
To: log4j-user@logging.apache.org
Subject: Diff between Logger and Log


Hello! I faced with a such situation when Logger and Log act differently.
I configure my log4j with

DOMConfigurator.configureAndWatch(xmlFileName);

In the configure xml file there is defined only one appender - FileAppender.
So, when I'm using

Log log = LogFactory.getLog(name);

and then

log.info("I'm a log!");

it writes this log to file.

But when I'm using

Logger logger.getLogger()....
or
LogManager.getLogger()....

they write logs only to the console! Why don't they use configurations from xml file?

context: I deploy my app to JBoss AS, I use my owm log4j.xml (not JBoss'
one), I added log4j.jar to the lib of my .ear project.

Thank you!
--
View this message in context: http://www.nabble.com/Diff-between-Logger-and-Log-tp25679656p25679656.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


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


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


Mime
View raw message