Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multithreading and logging redirection in a servlet

Status
Not open for further replies.

billcomer

Programmer
Dec 13, 2005
1
EU
I have a requirement that all servlets in an application return immediately and with a standard response. Any processing needs to be done offline.

I could have the servlet log the request to a database for a separate application to pick up. However I was hoping to still do all the work in the servlet.

We are using an apache/tomcat webserver, java 1.4.2 and the standard logger java.util.logging.Logger. My solution so far is for the servlet to kick off a Thread (defined as an inner class in the same file as the servlet) to do the work and let the doGet respond back to the requestor.

This works fine with one problem. Logging.
Any logger calls in the thread log to catalina.out while logger calls in the doGet log to the correct application log file defined in the tomcat configuration.

Any ideas how this can be resolved ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top