Harris, Jeffrey E. wrote:

-----Original Message-----
From: André Warnier [mailto:a...@ice-sa.com]
Sent: Monday, March 11, 2013 4:34 AM
To: Tomcat Users List
Subject: Re: Console when running as a service.

Sam Takoy wrote:
Hi,

Just installed Tomcat 7 as a service (by running "service install").

This is a change for me: historically, I've been running tomcat by
running "startup" in "tomcat/bin", but now I want to get with the
times.
With my new, better way of running tomcat, how do I monitor with the
server is writing to stdout and stderr? I know where to find the
content (tomcat7-stderr.2013-03-11.log, etc.) but what is a good way to
monitor it, i.e. see what's going on as it is happening?
Well, basically it is either the one or the other, can't have your cake
and eat it, etc..
A "Service" or "daemon", by definition, runs in the background and
doesn't give you a real-time console to look at.
Under Unix/Linux, you could use a command like "tail -f <logfile>"
which would display the end of the logfile as it is being written.  But
I do not know if Windows has any equivalent thing.


Yes, there are versions of tail for Windows; Google is our friend.  One version 
is at http://tailforwin32.sourceforge.net/.

Talking about "getting with the times", maybe you are missing another
evolutionary step here : virtualisation (see Vmware etc.).  Basically,
this allows you to create a "virtual machine" in which to run Windows
(and Tomcat), and to connect from a remote location to the (also
virtual) console of that machine.  This would allow you to continue to
run Tomcat in a command window (and see STDOUT/STDERR), without some of
the inconvenients due to having to have a physical console to run it
on.

But some of the advantages of using a service (whether on a physical or virtual 
server) are automatic startup (without having to be logged into the server) at 
boot time, and the ability to restart the service or to take other action if 
the service should stop (presuming that the cause of the stoppage was not 
something that would prevent the service from starting again).

And the console only contains a limited amount of information (even considering 
the data accessible by scrolling back in the window), so if one is not 
constantly monitoring the console, one is likely to miss events that would also 
be captured in the log files.


I agree with all the above.

On the other hand, running in a console (or command window) as a normal process also has some advantages compared to running as a Service. For example, a lot of standard Windows programs will not run, or not correctly, when used in a Service context (MS-Office programs for example). So if for some scenarios, it would be useful to use say MS-Word to produce a PDF version of a document, it is not possible (or very difficult) to trigger this from Tomcat when running as a Service. But it runs perfectly well when Tomcat runs in a command window.

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

Reply via email to