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: [email protected]
For additional commands, e-mail: [email protected]