Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.
(Answer) (Category) Java Apache Project : (Category) Trash :
Logging Servlet Output
> Whilst developing servlets my development 
> team often put System.err.println() statements in the servlet code. 
> Unfortunately, these error strings always get printed to main apache
> error log and not the virtual host or servlet zone's error log. Has anyone
> encountered this problem before and found a solution to isolate the errorlog output. 

have them use 

log("error string); 

or
getServletContext.log(e, "an error ");


or
use the following and write the error stack trace back to the browser or to the log.

        /* PrintStackTraceAsString from com.oreilly.servletServletUtils from 
                Java Servlet Programming, by Jason Hunter and William Crawford, O'Reilly, 1998 
        */
        public String getStackTraceAsString(Exception e){
                ByteArrayOutputStream bytes = new ByteArrayOutputStream();
                PrintWriter writer = new PrintWriter(bytes, true);
                e.printStackTrace(writer);
                return bytes.toString();
        }
brettATknightsofthenetDOTcom
[Append to This Answer]
Previous: (Answer) Error : IllegalAccessError?
Next: (Answer) Running servlet like cgi
This document is: http://java.apache.org/faq/?file=289
[Search] [Appearance] [Show Expert Edit Commands]
This is a Faq-O-Matic 2.709.
Please browse the categories below to previous answers to questions like yours. If you do not find the answer for your particular situation, ask for help on the appropriate mailing list.