[crossposting to the surefire and log4j mailing lists]
Hello everybody,
Can you help me with a problem? I am running surefire unit tests against
a spring application. I am trying to see the debug messages spring puts
out. The messages show up when I deploy the application into JBoss, but
when I run the surefire unit tests they don't show up.
Here is my surefire config from my pom.xml file:
<!-- Surefire test runner plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.3</version>
<configuration>
<argLine>-Dlog4j.debug</argLine>
<systemProperties>
<property>
<!-- Specific log4j config for tests -->
<name>log4j.configuration</name>
<value>file:./src/main/config/test-log4j.properties</value>
</property>
</systemProperties>
</configuration>
</plugin>
the log4j properties has this content:
log4j.rootLogger=TRACE, R
log4j.appender.R=org.apache.log4j.ConsoleAppender
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{3}:%L -
%m%n
and the -Dlog4j.debug produces this output:
log4j: Using URL [file:./src/main/config/test-log4j.properties] for
automatic log4j configuration.
log4j: Reading configuration from URL
file:./src/main/config/test-log4j.properties
log4j: Parsing for [root] with value=[TRACE, R].
log4j: Level token is [TRACE].
log4j: Category root set to TRACE
log4j: Parsing appender named "R".
log4j: Parsing layout options for "R".
log4j: Setting property [conversionPattern] to [%d{ABSOLUTE} %5p
%c{3}:%L - %m%n].
log4j: End of parsing for "R".
log4j: Parsed "R" options.
log4j: Finished configuring.
Thank you everybody.