Note that there are some explanatory texts on larger screens.

plurals
  1. POCan't turn off HtmlUnit logging messages
    primarykey
    data
    text
    <p>I'm using HtmlUnit to interact with a web page that interacts with the server via Ajax. Soon after the Ajax code starts, HtmlUnit produces these two log messages:</p> <pre>WARNING: Ignoring XMLHttpRequest.setRequestHeader for Content-length: it is a restricted header Mar 3, 2011 3:32:47 PM com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest jsxFunction_setRequestHeader WARNING: Ignoring XMLHttpRequest.setRequestHeader for Connection: it is a restricted header Mar 3, 2011 3:32:47 PM com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest jsxGet_status</pre> <p>...Followed by this message, repeated six times:</p> <pre>SEVERE: XMLHttpRequest.status was retrieved before the response was available. Mar 3, 2011 3:32:47 PM com.gargoylesoftware.htmlunit.javascript.host.xml.XMLHttpRequest jsxGet_status</pre> <p>I can't figure out how to turn these messages off. Trawling through the code shows that they're produced by direct calls to a logger, not via a handler object that I could provide a do-nothing implementation for, as I already do for CSS errors. The <a href="http://htmlunit.sourceforge.net/logging.html">HtmlUnit logging page</a> indicates that adding this code should work:</p> <pre><code>System.getProperties().put("org.apache.commons.logging.simplelog.defaultlog", "fatal"); </code></pre> <p>...but it has no effect. I also tried adding the following option where I invoke java:</p> <pre><code>-Dorg.apache.commons.logging.simplelog.defaultlog=fatal </code></pre> <p>...but that also has no effect.</p> <p>I guess I could redirect stderr to /dev/null while this code is executing, but are any less hacky solutions available?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload