You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by ga...@tele2.ch on 2005/03/31 07:21:11 UTC

Possible solution for turning off some log messages within JUnit

Hi, my "solution" for filtering the (debug) messages during JUNIT:

Create an log4j.properties in ./src/test/: (the log.category... does the filtering)
# ==============================================================================
# logging facility
# ==============================================================================
# For test use:
log4j.rootCategory=DEBUG, stout

#
# Limit the output of the org.apache logging to INFO
#
log4j.category.org.apache=INFO

# configure the standard-out appender
log4j.appender.stout=org.apache.log4j.ConsoleAppender
log4j.appender.stout.layout=org.apache.log4j.PatternLayout
log4j.appender.stout.layout.ConversionPattern=%F:%M [%L] %5p - %m%n

Use the following props in project.properties:

# When using Java 1.4, it may be necessary to fork the JUnit tests to prevent 
# XML parser issues. The default value is no.
#
maven.junit.fork=true

# set some properties to get the logging subsystem to work
# 
# here are the property names:
#
maven.junit.sysproperties=log4j.configuration

# and here are the values:
#
log4j.configuration=file:src/test/log4j.properties


This config also works for me within eclipse (run a JunitTest).

Hope this helps.

Cheers
Rolf

-------------------------------------------------
WebMail from Tele2 http://www.tele2.ch
-------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org