You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Glenn Nielsen <gl...@voyager.apg.more.net> on 2001/04/25 05:59:38 UTC

Tomcat 4 stderr & stdout

>From their behaviour, it appears that Tomcat 3.x and Tomcat 4 handle
use of stderr and stdout differently.

Running under unix with either works great for me.

But under windows others I work with have had problems.
When running Tomcat 4 with -security and -djava.security.debug=all,
the security debug output gets dumped to the DOS shell.  Any attempt
to use the DOS redirect to file fails to capture the output.  This
makes it nearly impossible to debug Java SecurityManager security exceptions.

Anyone know the difference between Tomcat 3.x and Tomcat 4 in how they
handle stdout and stderr?  Or have any ideas of how to capture the
output from Tomcat 4 under windows?
 
Thanks,

Glenn

----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

Re: Tomcat 4 stderr & stdout

Posted by Glenn Nielsen <gl...@voyager.apg.more.net>.
Ignore this, the difference was that the user was starting
Tomcat in a DOS shell instead of as an NT Service.

Glenn Nielsen wrote:
> 
> >From their behaviour, it appears that Tomcat 3.x and Tomcat 4 handle
> use of stderr and stdout differently.
> 
> Running under unix with either works great for me.
> 
> But under windows others I work with have had problems.
> When running Tomcat 4 with -security and -djava.security.debug=all,
> the security debug output gets dumped to the DOS shell.  Any attempt
> to use the DOS redirect to file fails to capture the output.  This
> makes it nearly impossible to debug Java SecurityManager security exceptions.
> 
> Anyone know the difference between Tomcat 3.x and Tomcat 4 in how they
> handle stdout and stderr?  Or have any ideas of how to capture the
> output from Tomcat 4 under windows?
> 
> Thanks,
> 
> Glenn
> 
> ----------------------------------------------------------------------
> Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
> MOREnet System Programming               |  * if iz ina coment.      |
> Missouri Research and Education Network  |  */                       |
> ----------------------------------------------------------------------

-- 
----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

Re: Tomcat 4 stderr & stdout

Posted by Glenn Nielsen <gl...@voyager.apg.more.net>.
"Craig R. McClanahan" wrote:
> 
> On Tue, 24 Apr 2001, Glenn Nielsen wrote:
> 
> > >From their behaviour, it appears that Tomcat 3.x and Tomcat 4 handle
> > use of stderr and stdout differently.
> >
> > Running under unix with either works great for me.
> >
> > But under windows others I work with have had problems.
> > When running Tomcat 4 with -security and -djava.security.debug=all,
> > the security debug output gets dumped to the DOS shell.  Any attempt
> > to use the DOS redirect to file fails to capture the output.  This
> > makes it nearly impossible to debug Java SecurityManager security exceptions.
> >
> > Anyone know the difference between Tomcat 3.x and Tomcat 4 in how they
> > handle stdout and stderr?  Or have any ideas of how to capture the
> > output from Tomcat 4 under windows?
> >
> 
> I'd bet that somewhere in the 3.x code there is a line:
> 
>         System.setErr(System.out);
> 
> to reset the error stream to the same as standard output.
> 
> I'm OK with you putting that into Bootstrap.java, as long as you make sure
> it works with a security manager installed :-).
> 

Hah!  As you can tell from my recent commits I am still making some
SecurityManager changes.  Some of them were found from trying to
run Struts in Tomcat 4 using the SecurityManager and a very restrictive 
security policy.

BTW, great job with struts.  It looks very complete and well documented.

Regards,

Glenn

----------------------------------------------------------------------
Glenn Nielsen             glenn@more.net | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

Re: Tomcat 4 stderr & stdout

Posted by "Craig R. McClanahan" <cr...@apache.org>.

On Tue, 24 Apr 2001, Glenn Nielsen wrote:

> >From their behaviour, it appears that Tomcat 3.x and Tomcat 4 handle
> use of stderr and stdout differently.
> 
> Running under unix with either works great for me.
> 
> But under windows others I work with have had problems.
> When running Tomcat 4 with -security and -djava.security.debug=all,
> the security debug output gets dumped to the DOS shell.  Any attempt
> to use the DOS redirect to file fails to capture the output.  This
> makes it nearly impossible to debug Java SecurityManager security exceptions.
> 
> Anyone know the difference between Tomcat 3.x and Tomcat 4 in how they
> handle stdout and stderr?  Or have any ideas of how to capture the
> output from Tomcat 4 under windows?
>  

I'd bet that somewhere in the 3.x code there is a line:

	System.setErr(System.out);

to reset the error stream to the same as standard output.

I'm OK with you putting that into Bootstrap.java, as long as you make sure
it works with a security manager installed :-).


> Thanks,
> 
> Glenn
> 

Craig