Hmmm...
First, I tried Arthur's suggestion and added created log4j.properties file in 'src/test/resources'. I even moved all of my Spring test *-context.xml files to that directory. Maven runs my tests and picks up my context files just fine, but no test log was created anywhere on my machine.
I tried passing the log file location to maven with a
Code:
mvn -Dlog4j.configuration=file:C:/work/workspace/compliance_wire/src/test/resources/log4j.properties clean site
No log file with this approach either.
I tried using a file relative to the current directory, instead of using an absolute path.
Still, nothing different happened there for me.
Finally, I tried standing on my desk at work and screaming at the top of my lungs.
I then did another clean-compile-test and still saw no log file for my tests. Screaming didn't seem to get things working for me either, and I think I scared someone's kid.
Is this supposed to be such a PITA or am I just missing something?
Let's recap it one more time, shall we?
Currently I have my test log4j.properties file here:
Code:
/src/test/resources/log4j.properties
Here's my test log4j.properties file:
Code:
# For JBoss: Avoid to setup Log4J outside $JBOSS_HOME/server/default/deploy/log4j.xml!
# For all other servers: Comment out the Log4J listener in web.xml to activate Log4J.
log4j.rootLogger=DEBUG, application, jms
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %p [%c] - %m%n
#JMS Appender
log4j.appender.jms=org.apache.log4j.RollingFileAppender
log4j.appender.jms.MaxFileSize=10MB
log4j.appender.jms.File=test_jms.log
log4j.appender.jms.layout=org.apache.log4j.PatternLayout
log4j.appender.jms.layout.ConversionPattern=%d %p [%c] - %m%n
#Application Appender
log4j.appender.application=org.apache.log4j.RollingFileAppender
log4j.appender.application.File=log4j.appender.logfile.File=test_servlet.log
log4j.appender.application.MaxFileSize=10MB
log4j.appender.application.layout=org.apache.log4j.PatternLayout
log4j.appender.application.layout.ConversionPattern=%d %p [%c] - %m%n
#Filters
log4j.category.org.apache.commons.digester=WARN
log4j.category.org.springframework=INFO
log4j.category.org.hibernate=INFO
log4j.category.org.hibernate=INFO
log4j.category.org.apache.activemq=DEBUG
# Keep three backup files.
log4j.appender.logfile.MaxBackupIndex=3
And... yeah.
Any (further) help is greatly appreciated.