I am using HtmlUnit to get some info from various web pages and when running the application it writes all page errors, CSS errors, script errors, from those pages. Can I shut that off? Thanks!
Asked
Active
Viewed 897 times
0
-
You mean it's all output to the console? Do you have a log4j config file, most or all of it can be disabled via that. – Rodney Gitzel May 16 '11 at 23:40
-
right, ouput to the console.I am not sure about the log4j file?? where is that located? – Jake Sankey May 17 '11 at 13:52
1 Answers
1
Put a file called "log4j.properties" in the root of your source code (i.e. where your "com" or "net" or what have you folders are) with this in it:
log4j.rootLogger=WARN,stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %c [%p] - %m%n
log4j.category.com=NONE
log4j.category.com.gargoylesoftware.htmlunit.javascript=NONE
You can then experiment the lines like the last two to turn logging on or off for various packages. log4j.category.com=NONE
should take care of pretty much ALL of it.

Rodney Gitzel
- 2,652
- 16
- 23