« A simple, localized, Wicket country list modelSomeone out there is a total moron »

Gently asking the GWT Hosted Mode to NOT redirect the logs

01/27/09

Permalink 01:17:36 pm, by nogunner Email , 175 words   English (US)
Categories: GWT

Gently asking the GWT Hosted Mode to NOT redirect the logs

In hosted mode, GWT redirects all the logging calls made with commons-logging to its own "TreeLogger", so that any useful logs emitted server-side are redirected to it (and most likely lost). Not only is this annoying, it also breaks the expected consistency with the normal deployment state.

Technically, the GWT makes a System.setProperty("org.apache.commons.logging.Log", adapterClassName) call. Fortunately, the apache commons logging library preempts this setting with its own configuration file.

Just create a file called "commons-logging.properties" at the root of your classpath, and add the following line:

[to use the Log4j backend]

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

[to use the JDK14 backend]

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Jdk14Logger

[to use the SimpleLog backend]

org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog

etc. well, you got it.

(OK, the title of this article is misleading, we're not really asking the GWT to not redirect, but rather asking commons-logging to ignore the GWT request)

Feedback awaiting moderation

This post has 3 feedbacks awaiting moderation...

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
PoorExcellent
(Line breaks become <br />)
(Name, email & website)
(Allow users to contact you through a message form (your email will not be revealed.)
nogunner's blog

Pointless technical stuffs are the bomb diggity of life.

September 2010
Sun Mon Tue Wed Thu Fri Sat
 << <   > >>
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Search

XML Feeds

Web Monitoring

Be sure to check my LinkLogics web monitoring application if you happen to need external monitoring.
powered by b2evolution free blog software