I am trying to use commons-logging with log4j to write my app logs to a file, but my logs keep going to SystemOut.log. The log file did get created, but its empty.
Here's my log4j.properties and commons-logging.properties(both should be on classpath - they're under WEB-INF/classes)
WEB-INF/classes/ log4j.properties :
log4j.appender.AppLogAppender.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
The fact that the file is empty is telling us that indeed your own
log4j.properties is being called, and not some other
log4j.xml in the classpath. Remember, File Appenders in log4j are designed so the output file is created as soon as log4j initializes - not waiting for the first log line to go there.
Now, I think you're missing this in your commons-logging.properties:
If that doesn't help, add the necessary system property to your WAS instance to activate log4j in "debug mode" - property name