On Thu, Sep 13, 2001 at 07:20:06PM -0700, Abhijat Thakur wrote:
> Hi,
> 
> I have gone through the archives and have looked at the original responses
> and tried it but my System.err.println does not go to /logs/tomcat.log. I am
> using log4j for logging but at some place have to put System.err.println
> statements which i want should be printed to tomcat logs.
> 
> I have made modifications to server.xml and it has
> 
> <Logger name="tc_log"
>             verbosityLevel = "INFORMATION"
>              path="logs/tomcat.log"
>     />
> 
>     <Logger name="servlet_log"
>             path="logs/servlet.log"
>             verbosityLevel = "DEBUG"
>     />
> 
>     <Logger name="JASPER_LOG"
>           path="logs/jasper.log"
>         verbosityLevel = "INFORMATION" />

There isn't a <Logger> directive which will change where stdout/stderr
go. By default in 3.2.x, logs go to stdout of the caller. This is a real
pain, because sysadmins invariably forget to fix this. Then when you've
got multiple developers, the last one to restart Tomcat gets the logs.
If you're stuck with 3.2.x, you should modify tomcat.sh by hand to
redirect stdout/err to a file.

3.3 fixes this by redirecting stdout and stderr to
$TOMCAT_HOME/logs/stdout.log. 4.0 does the same, routing both to
catalina.out.

In case you were wondering, there's no way to get context-specific
stdout and stderr.

--Jeff

> The three are files are made under logs but my System.err.println messages
> dont go there. Please advise.
> 
> Thanks a lot.
> 
> 
> Abhijat Thakur
> 
> bDNA Corporation

Reply via email to