my dog learned polymorphism
The moose likes Tomcat and the fly likes Tomcat, @WebFault logging Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat, @WebFault logging" Watch "Tomcat, @WebFault logging" New topic

Tomcat, @WebFault logging

Gavin Tranter
Ranch Hand

Joined: Jan 01, 2007
Posts: 333
I have a webservice that uses JAX-WS running in a Tomcat container.
The Service uses log4j as it logger, while Tomcat is using Java.util.logging (or rather its extension to it).

We have the service logging to its own log file, so as to keep the catalina log file for tomcat logging and the service log file for the service.

However when we get a service exception, it is to be logged in both logs, now i have tried all ways i can think of, and short of removing the console appender/handler from the tomcat configuration I cant get the exception to remain in the service log file.

I have checked for System.out and System.err and also for Throwable.printStackTrace and we are clean of those.

So how is this exception getting logged by both log files? Given that it seems to be the console handler that is logging the exception, I was wondering if it could be to do with the @WebFault annotation our exception has, that perhaps tomcat was reading and logging these exceptions at the container level?

I will be writing an experiment, but thought i would ask teh question here, in case there was something else I may have missed.

I agree. Here's the link:
subject: Tomcat, @WebFault logging
jQuery in Action, 3rd edition