I'm glad somebody else has this problem.
There are two logs with Apache: 1) the error.log and 2) the servlet log
xxxx_jserv.log which can be stored anywhere (I have mind stored in the
apache/logs directory.
Unfortunately, messages only seem to be stored to this log when you get a
server error. For example, if you use
response.sendError(response.SC_INTERNAL_SERVER_ERROR,"error message") this
gets printed to the xxxx_jserv.log. If you don't use this log then I
believe it goes to the
apache error.log. For your case when logging an exception you can set the
INTERNAL_SERVER_ERROR
response and get the message. However, if you want to such log comment like
info or debug, this
information seems to go nowhere. I had to open my own log in the init()
method, overwrite the log
method with my own, and close it in the destroy() method. Note, you have to
synchronize around your
output stream. I am not sure how this would work if you use the single
threaded model but I know
it works for multiple request threads. Don't know if this helps. If anyone
else knows what JServ
is doing I would like to be enlightened....
Chris
-----Original Message-----
From: Ben Coppin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 19, 1999 5:32 AM
To: [EMAIL PROTECTED]
Subject: Error logging in servlets
Hi,
Just a quickie:
When you do something like:
try
{
blah;
}
catch (Exception E)
{
getServletContext ().log (e, "an error occurred");
}
where does the log message get saved? I can't find a log file with it in...
I'm using apache with Jserv 1.0.
Thanks,
Ben
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html