Find log4j logger of some class in your classpath
Every time I was running my Java application, I first saw a log4j error saying it couldn't write to the $JAVA_HOME/somelog.log file. Apparently this is the default location where log4j stores its logfiles. This directory is default not writable by non-root users.
The logfile itself didn't contain any indication of which classes are really logging content, or which logger is used to do this.
To find out which loggers are used, launch your program with the following system property:
-Dlog4j.defaultInitOverride=true
It will complain that it couldn't find a logger for 'x'. Once you have the 'x', you can configure this logger in your log4j.properties:
log4j.logger.x = DEBUG,A
log4j.appender.A=org.apache.log4j.FileAppender
log4j.appender.A.File=a.log
log4j.appender.A.layout=org.apache.log4j.PatternLayout
log4j.appender.A.layout.ConversionPattern=%d{MM-dd@HH:mm:ss} %-5p (%13F:%L) %3x - %m%n
