This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Then here's the first thing you should learn about servlets: The purpose of a servlet is to receive an HTTP request from a client, produce a response, and send it to that client.
So now think about it. Where does logging fit into that? If you were to write a "logging servlet", what HTTP requests would it be handling? And what about all of those other servlets, which are handling HTTP requests relating to your real business requirements? Wouldn't they get to do logging?
In other words: yes, logging needs to be done in the web application. But just because something needs to be done, that doesn't imply you have to create a servlet to do it. Not everything in a web application is a servlet. Just use log4j in the normal way, by putting logging code wherever it needs to be put.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Best way to implement logging in a servlet based web app