I can tell you how I use file based logging for my servlets. I use Log4J from
http://jakarta.apache.org/log4j There are several ways to use this package. First, import the necessary classes.
Then create a class variable for this logging object.
In your servlet's init() method, configure the logger.
In your doPost() and doGet() methods, you can send very detailed debug or error messages.
The log4j classes are well documented and easy to use. They are a valuable tool for servlet/DB developers and well worth learning.
-Ben