In the JSDK api in HttpServlet there's the method getServletContext()
which returns the current context. The ServletConext then has a method
called log(), and guess what, this is the thing you need!
It works similar to System.out.println(), the famous debugging method
for the real experienced java programmer ;-)

To make sure that you log file contains the log ouput add/change the
following in jserv.properties:
log.file=/usr/local/jserv/logs/jserv.trace
log.channel.servletLog=true   <-- THIS IS THE MOST IMPORTANT ENTRY!!!!!!

Make sure that log.file is fully qualified, otherwise you might get in
troubles.
Of course, set the log.file to what you nedd!

The other log.channel.* params are for debugging jserv itself, so maybe
you wish to disable them, but some of them are still usefull.

PAUL J THOMPSON wrote:
> 
> Question:  I have been having trouble debugging my servlets because of
> the lack of any stdout or stderr.  Is there some way that you can write
> error messages to the jserv log file?  Something like:
> 
>         out.println("The program experienced a major fubar here!");
> 
> So that it would be a little easier to keep track of what is going on.
> Otherwise, debugging can be quite the pain in the rear.
> 
> Thanks,
> Paul J Thompson
> 
> -- --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> READ THE FAQ!!!!     <http://java.apache.org/faq/>
> Archives and Other:  <http://java.apache.org/main/mail.html/>
> Problems?:           [EMAIL PROTECTED]

-- 
Guenther Wieser      
creative-it/Guenther Wieser Software KEG
Student of Telematik at Graz University of Technology
http://www.creative-it.com        mailto:[EMAIL PROTECTED]
-> In A World Without Walls And Fences, Who Needs Windows And Gates? <-


-- --------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
READ THE FAQ!!!!     <http://java.apache.org/faq/>
Archives and Other:  <http://java.apache.org/main/mail.html/>
Problems?:           [EMAIL PROTECTED]

Reply via email to