Chris:
If it helps any, a quick trick I've used with JServ is to write to
System.err - that goes in the error_log file in the logs directory. Can't
find System.out anywhere, and you're right, the log doesn't seem to write
either, at least not the way I have things set up. I went with your approach
here, extending the standard logging.
Mike
> -----Original Message-----
> From: A mailing list for discussion about Sun Microsystem's
> Java Servlet
> API Technology. [mailto:[EMAIL PROTECTED]]On
> Behalf Of Dean,
> Chris J #LOSC
> Sent: Thursday, August 19, 1999 10:53 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Error logging in servlets
>
>
> 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
>
___________________________________________________________________________
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