Sorry to get in on this thread late. See if the following does what you want:
public void init(ServletConfig config) throws ServletException
{
super.init(config);
//
// Redirect standard out to a file.
//
try {
BufferedOutputStream output = new BufferedOutputStream(
new FileOutputStream(servletRoot + "/servletError.log", true));
System.setOut(new PrintStream(output, true));
}
catch (Exception e) {
logMessage(e, "An error occurred when opening the log file.");
}
...
Jay
-----Original Message-----
From: Ross Nicoll [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 13, 2001 10:26 AM
To: [EMAIL PROTECTED]
Subject: Re: JServ Apache debugging
On Tue, 13 Nov 2001, Godbey, David wrote:
> Are there any philosophical issues that I'm missing? Is the absence of
> System.out and System.err support inside Apache/JServ by design?
If you provide your servlets with an "init (ServletConfig config)" method,
you can then use the "ServletConfig.getSevletContext ()" methd to get the
servlet's context. This provides "log (String msg)" and "log (String
msg, Throwable throwable)" methods, which may help with your problem?
___________________________________________________________________________
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