It took far too long to find this out, but JWebUnit comes bundled with the Logback logging component, so it won't even use log4j.properties
or commons-logging.properties
.
Instead, create a file called logback.xml
and place it in your source code folder (in my case, src
):
<configuration debug="false">
<!-- definition of appender STDOUT -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%-4relative [%thread] %-5level %logger{35} - %msg %n</pattern>
</encoder>
</appender>
<root level="ERROR">
<!-- appender referenced after it is defined -->
<appender-ref ref="STDOUT"/>
</root>
</configuration>
Logback looks to still be under development and the API seems to still be changing, so this code sample may fail in the future. See also this StackOverflow question.