I am running into problems properly disabling ALL HtmlUnit logging. I'm not even sure where the information is coming from.
The project code all exists HERE on github.
I see console output like:
HtmlTextInput[<input type="text" class="text_" name="j_username" id="username">] -> HtmlHtml[<html lang="en" class="no-js ie8">]
I've read the logging section of the HtmlUnit docs and I've simplified down to the following which does remove everything except for the HtmlTextInput log listed above.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd" >
<log4j:configuration>
<appender name="NULL" class="org.apache.log4j.varia.NullAppender" />
<appender name="stdout" class="org.apache.log4j.ConsoleAppender">
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ABSOLUTE} %5p %c{1}:%L - %m%n" />
</layout>
</appender>
<logger name="com.gargoylesoftware">
<level value="OFF" />
<appender-ref ref="NULL" />
</logger>
<root>
<priority value="warn" />
<appender-ref ref="NULL" />
</root>
</log4j:configuration>
My commons-logging.properties file looks like:
# JDK Logging
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger
# Log4j logging (also required log4j.jar to be in classpath)
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
My Pom file contains:
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.15</version>
<scope>test</scope>
</dependency>
In addition I've tried suggestions listed in the following places:
http://htmlunit.sourceforge.net/logging.html
http://alexcuesta.wordpress.com/2011/05/11/turning-off-htmlunit-driver-logging-messages/
Any help is appreciated.