Thursday, 15 October 2009

How does log4j load the config files ?

Add -Dlog4j.debug to the command line.


trace file :

log4j: Trying to find [log4j.xml] using context classloader sun.misc.Launcher$AppClassLoader@11b86e7.
log4j: Trying to find [log4j.xml] using sun.misc.Launcher$AppClassLoader@11b86e7 class loader.
log4j: Trying to find [log4j.xml] using ClassLoader.getSystemResource().
log4j: Trying to find [log4j.properties] using context classloader sun.misc.Launcher$AppClassLoader@11b86e7.
log4j: Trying to find [log4j.properties] using sun.misc.Launcher$AppClassLoader@11b86e7 class loader.
log4j: Trying to find [log4j.properties] using ClassLoader.getSystemResource().
log4j: Could not find resource: [null].
ControlListener Created





Links :
http://jaitechwriteups.blogspot.com/2006/07/know-how-log4j-tries-to-configure.html
http://jaikiran.wordpress.com/2006/07/05/i-get-log4jwarn-no-appenders-could-be-found-for-logger-message-2/
 

No comments: