0

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!

Jake Sankey
  • 4,977
  • 12
  • 39
  • 53

1 Answers1

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