You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Abhijat Thakur <ab...@bdnacorp.com> on 2001/09/14 04:20:06 UTC

System.err.println

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" />

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


Re: System.err.println

Posted by Jonathan Eric Miller <je...@uchicago.edu>.
I think at least for Tomcat 4, it depends on what platform you are running
on. I noticed that on UNIX it gets redirected to catalina.out, but, on
Windows it just gets displayed to the screen.

Jon

----- Original Message -----
From: "Abhijat Thakur" <ab...@bdnacorp.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, September 13, 2001 9:20 PM
Subject: System.err.println


> 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" />
>
> 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
>


Re: System.err.println

Posted by Jeff Turner <je...@socialchange.net.au>.
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

Re: System.err.println

Posted by Dmitri Colebatch <di...@bigpond.net.au>.
On Thu, 13 Sep 2001, Abhijat Thakur wrote:

> 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.

why not use servlet.log() if you want that functionality?  afaik routing
System.err.println is not covered by the spec (but I may be wrong), and so
you will be relying on specific container bahaviour.

alternatively on unix you could just redirect stderr to whichever file you
wanted.

hth,
cheesr
dim


> 
> 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" />
> 
> 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
> 
>