You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by André Warnier <aw...@ice-sa.com> on 2010/02/05 15:08:18 UTC

Re: Unix creates the catalina.out but on Windows it does not

Karthik Nanjangude wrote:
> Hi
> 
> Please validate the same
> 
> O/s  Windows NT 2006  / Unix
> JDK 1.5
> TOMCAT 6.0.20 / 6.0.24 ( *.zip)
> 
> 
> Problem
> 1) Same Tomcat installed server on Unix creates the "catalina.out" but on Windows it does not Why ?.
> 
> 2) Know How to use JConsole but need additional info How to  monitor the Connection pool of  applications running on Tomcat ...?
> 
> 
No idea about #2, but about #1 :

Tomcat itself does not write to "catalina.out".
Tomcat runs inside a JVM, and through the JVM, it may write some 
messages to STDOUT and STDERR.
If you run the JVM (and Tomcat) inside a console window (a command 
window under Windows), you will see these messages directly on the 
screen, because then that is where STDOUT/STDERR end up.

If you run Tomcat as a daemon (under Unix/Linux), or as a service (under 
Windows), then the first thing to look at is the way in which the JVM is 
being started, to check where STDOUT/STDERR are being /re-directed/.

Under Unix/Linux, have a look at (tomcat_dir)/bin/catalina.sh, and maybe 
also is in the script which starts Tomcat as a daemon. This may be in 
/etc/init.d, or /sbin/init.d or in /etc/rc.d/init.d, depending on the OS.

Under Windows, you are probably running the JVM and Tomcat under a 
"service wrapper" (e.g. bin/tomcat6.exe).  If so, it is probably that 
one which redirects the JVM's STDOUT/STDERR, and probably to the Windows 
Event Logs instead of the file "catalina.out".
Note that tomcat6.exe, despite its name, is not really Tomcat.
It is really that : a "wrapper" program which starts the JVM which runs 
Tomcat.  The main function of this wrapper is to make the JVM "look like 
a Service" for Windows.
The tomcat6w.exe is a GUI program, which allows you to set some 
parameters in the Registry, for the tomcat6.exe program.
tomcat6w.exe and tomcat6.exe, together, "replace" the functionality of 
the Unix/Linux startup scripts (startup.sh, catalina.sh, 
/etc/init.d/tomcat e.g.).

To make matter just a little bit more confusing, some Linux 
distributions start the JVM which starts Tomcat, using also a wrapper 
called "jsvc".  This wrapper, among other things, allows Tomcat to use 
ports below 1025 even when not running Tomcat as root.

All the above relates to the (relatively few) messages which Tomcat and 
the JVM which runs it, write to STDOUT/STDERR.
Tomcat components and applications normally write their logging messages 
according to this :
http://tomcat.apache.org/tomcat-6.0-doc/logging.html
Good luck.





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Unix creates the catalina.out but on Windows it does not

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: André Warnier [mailto:aw@ice-sa.com]
> Subject: Re: Unix creates the catalina.out but on Windows it does not
> 
> What is still not quite clear to me upon consulting that page, is how
> to provide the following service parameters :

You can do it /when installing the service/, by editing the Windows registry (but I wouldn't recommend that for newbies), or by using the Logging tab in the GUI manager (tomcat6w.exe).

> --LogPath    Defines the path for logging
> --LogPrefix  Defines the service log filename

Note that the above is for the logging done by the service wrapper, not Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Unix creates the catalina.out but on Windows it does not

Posted by André Warnier <aw...@ice-sa.com>.
Caldarale, Charles R wrote:
...
> 
> The stdout/stderr files for Tomcat as a Windows service are in Tomcat's logs directory,
under the names stdout_yyyyMMdd.log and stderr_yyyyMMdd.log, respectively.

Thanks for provoiding that clarification, and sorry for my approximative 
explanation.

These may be changed by installing the service with the appropriate 
parameters.  See the procrun doc for details:
> http://commons.apache.org/daemon/procrun.html
> 
Right.  That was another item which I did not really want to get into, 
but since it is now out of the box..

Karthik,

what the above means is that what you see in tomcat/bin as respectively 
tomcat6.exe and tomcat6w.exe, are in reality the programs prunsrv.exe 
and prunmgr.exe, just renamed.
So what you find at
http://commons.apache.org/daemon/procrun.html
is the description of these programs.
To interpret that page in the context of Tomcat, just replace
"prunsrv" by "tomcat6.exe"
"prunmgr" by "tomcat6w.exe"

What is still not quite clear to me upon consulting that page, is how to 
provide the following service parameters :

--LogPath 	Defines the path for logging
--LogPrefix 	Defines the service log filename
--StdOutput 	Redirected stdout filename
--StdError 	Redirected stderr filename

in such a ways to end up with stdout_yyyyMMdd.log and 
stderr_yyyyMMdd.log respectively. (*)

neither in which tab/boix of the GUI these names/forms are specified.
But Chuck might tell us that too..

(*) or maybe even just "stdout.log", without the yyyMMdd part ?
Hope springs eternal.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Unix creates the catalina.out but on Windows it does not

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: André Warnier [mailto:aw@ice-sa.com]
> Subject: Re: Unix creates the catalina.out but on Windows it does not
> 
> Tomcat itself does not write to "catalina.out".
> Tomcat runs inside a JVM, and through the JVM, it may write some
> messages to STDOUT and STDERR.

Actually, Tomcat doesn't write anything to stdout and stderr, but site-supplied webapps often do, apparently being too lazy to use a logger.  These may be captured with the swallowOutput attribute of the <Context> element, if desired.

> Under Windows, you are probably running the JVM and Tomcat under a
> "service wrapper" (e.g. bin/tomcat6.exe).  If so, it is probably that
> one which redirects the JVM's STDOUT/STDERR, and probably to the
> Windows Event Logs instead of the file "catalina.out".

The stdout/stderr files for Tomcat as a Windows service are in Tomcat's logs directory, under the names stdout_yyyyMMdd.log and stderr_yyyyMMdd.log, respectively.  These may be changed by installing the service with the appropriate parameters.  See the procrun doc for details:
http://commons.apache.org/daemon/procrun.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org