You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sam Takoy <sa...@yahoo.com> on 2013/03/11 06:10:48 UTC

Console when running as a service.

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?

Many thanks in advance!

Sam

Re: Console when running as a service.

Posted by André Warnier <aw...@ice-sa.com>.
Harris, Jeffrey E. wrote:
> 
>> -----Original Message-----
>> From: André Warnier [mailto:aw@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: [OT] Re: Console when running as a service.

Posted by André Warnier <aw...@ice-sa.com>.
verlag.preisser@t-online.de wrote:
> Hi André,
> 
> 
> -----Original-Nachricht-----
>> Von: André Warnier <aw...@ice-sa.com>
>> An: Tomcat Users List <us...@tomcat.apache.org>
>> Betreff: Re: Console when running as a service.
>> Datum: Mon, 11 Mar 2013 19:20:23 +0100
> 
> 
>> +1. Eek, I tearfully and shamefully agree.
>> But still 90% or more of corporate internal documents are written as
>> Word documents, and there is no open-source tool which can perfectly
>> handle this shamefully proprietary format and convert it to some
>> non-propietary format that one could still read in 10 year's time, so
>> what is one to do if one wants to get some money to get one's children
>> through computer school and pay for their iPhones, he ?
> 
> I guess with "proprietary format" you mean the old/outdated .doc format? :)
> 
> This has been superseded (since 2006/2007) by the Office Open XML format which has been standardized as ECMA-376 and ISO/IEC 29500 [1], for which a public documentation is available, so I wouldn't call this proprietary. ;-)
> 
> However, you're probably right that a lot of already existing word documents are still in the old .doc format instead of .docx.
> 

This is still [OT], and I like the subject, so let's elaborate a bit.
The above paragraph responded to an "Eek", so it wasn't really meant as technically accurate.
But yes, by proprietary I did mean mainly the .doc, .xls and .ppt formats (and their 
associated template formats). And yes, there are still plenty of those around.
For instance, we recently processed a customer archive of more than 100,000 documents, in 
which there was a mixture of .doc, .xls, .ppt, .docx, .xlsx, .pptx, .pdf, .tiff, .txt and 
a few more.
But even if one talks about the supposedly "open" OpenXML formats .docx, .xlsx and .pptx, 
I have been unable so far to find any non-MS tool which can accurately process say more 
than 95% of your average collection of such documents without introducing some significant 
distorsions in the result, or corrupting or losing some content.  So I have to suppose 
that either of the following is true :
- the published specification is not accurate enough to cover all the cases one finds in 
real-world OpenXML documents
- the programmers who read these specifications are incapable of creating software that 
will accurately handle 100% of the documents which are created in this format
- the people who published this specification deliberately made it obscure so that others 
would have trouble interpreting it correctly
- the people who published this specification are deliberately making software that 
creates documents that violate the specification, to make life miserable for everyone 
else, particularly their commercial and non-commercial competition
- the people who published this specification are unwillingly making software that creates 
documents that violate the specification through sheer incompetence
- the people who published this specification are making software that creates documents 
that violate the specification, because they just don't care and because they published 
this specification only so that they could claim to support open-source trends and 
non-proprietary standards
- the programmers who read this specification are unwilling to create software that will 
accurately handle 100% of the documents which are created in this format, just to make a 
point about the spirit of open-source and how bad the companies who make proprietary 
software really are

..or more probably, a mixture of all the above.

And the practical result for everyone else it that it is a mess.

But I must add that I am not complaining about it too much, because if it wasn't so, I 
would not have either a product or a job. So please, MS and others, keep on adding new 
features, standards, revisions, versions, interpretations and new software which follows 
them or not, and I will happily spend time cleaning it all up for my bewildered customers.
(And, with a wink but nonetheless a background of seriousness, I would hasard to guess 
that the situation isn't too different when one reflects about Java and Tomcat).





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


[OT] Re: Console when running as a service.

Posted by "verlag.preisser@t-online.de" <ve...@t-online.de>.
Hi André,


-----Original-Nachricht-----
> Von: André Warnier <aw...@ice-sa.com>
> An: Tomcat Users List <us...@tomcat.apache.org>
> Betreff: Re: Console when running as a service.
> Datum: Mon, 11 Mar 2013 19:20:23 +0100


> +1. Eek, I tearfully and shamefully agree.
> But still 90% or more of corporate internal documents are written as
> Word documents, and there is no open-source tool which can perfectly
> handle this shamefully proprietary format and convert it to some
> non-propietary format that one could still read in 10 year's time, so
> what is one to do if one wants to get some money to get one's children
> through computer school and pay for their iPhones, he ?

I guess with "proprietary format" you mean the old/outdated .doc format? :)

This has been superseded (since 2006/2007) by the Office Open XML format which has been standardized as ECMA-376 and ISO/IEC 29500 [1], for which a public documentation is available, so I wouldn't call this proprietary. ;-)

However, you're probably right that a lot of already existing word documents are still in the old .doc format instead of .docx.


Regards,
Konstantin Preißer

[1] http://en.wikipedia.org/wiki/Office_Open_XML



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


Re: [OT] Console when running as a service.

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

André,

On 3/11/13 4:06 PM, André Warnier wrote:
> Mark Eggers wrote:
>> An alternate solution (which I've not played with in a very long
>> time) could be:
>> 
>> http://poi.apache.org/
>> 
>> This could remove the requirement for interacting with a desktop 
>> application when dealing with some Microsoft formats.
> 
> Thanks, I'll have a look at it (maybe again).

Since you have such a large volume of documents to process, you are an
ideal candidate for submitting bug reports and verifying fixes. Any
chance your employer would consider making an investment in you doing
such things? It could improve your product significantly (and save
your users licensing costs because they won't need Microsoft Office
running on their servers just to produce PDF documents).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEAREIAAYFAlE/TtQACgkQ9CaO5/Lv0PA0sQCcCqrpIMOYn/H5yEqFoubyf5rW
aUwAnib3aJCe5O5KUhGPQlJWfMVpKG8g
=RZiw
-----END PGP SIGNATURE-----

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


Re: [OT] Console when running as a service.

Posted by André Warnier <aw...@ice-sa.com>.
Mark Eggers wrote:
> On 3/11/2013 11:20 AM, André Warnier wrote:
>> pid@pidster.com wrote:
>>> On 11 Mar 2013, at 14:21, "André Warnier" <aw...@ice-sa.com> wrote:
>>>
>>>> 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.
>>>
>>> Eek! Eek I say!
>>>
>> +1. Eek, I tearfully and shamefully agree.
>> But still 90% or more of corporate internal documents are written as
>> Word documents, and there is no open-source tool which can perfectly
>> handle this shamefully proprietary format and convert it to some
>> non-propietary format that one could still read in 10 year's time, so
>> what is one to do if one wants to get some money to get one's children
>> through computer school and pay for their iPhones, he ?
> 
> Sigh, I agree if your constraint is "perfectly" then you're pretty much 
> stuck. However, even Microsoft doesn't deal with their formats "perfectly".
> 

Marking this OT now, because we are deriving significantly from the OP's original question.

My definition of "perfectly" in this case, is "pretty much undistinguishable from what the 
user himself would get if he told MS-Office : save this MS-Office document as PDF".
For 95% of MS-Office documents, OpenOffice for instance (which is no problem to run inside 
a Service context) will do a very good job.  Unfortunately, there are 5% of documents for 
which it will produce something of which the look (and even sometimes the content) differs 
significantly from the original document, and from the same PDF produced by MS-Office 
itself.  And 5% of hundreds of documents per day is a large number of documents.
For some users and some documents it doesn't really matter all that much, but for some 
others it does.  So again, it depends on the exact circumstances.

We have a similar issue with PDFs.  There are umpteen libraries out there which create 
PDFs, some of them better than others.  Some of them produce PDFs which are really buggy - 
in the sense of really not respecting the published PDF specification. But they can still 
be opened by the Adobe Acrobat Reader, which is the reference that most users refer to 
("If I can open it with Acrobat, then it's a correct PDF").  This is basically wrong, 
because the Adobe Acrobat Reader is rather tolerant, and will open and display some PDFs 
which are obviously sloppy.  But it forces us to also create tools which can read and 
process such sloppy PDFs, and maybe thus accept a PDF which the next generation of readers 
won't be able to open.

Sigh. Sometimes being correct and abiding by the rules conflicts with being practical, and 
one has to navigate between them as judiciously as possible.

> An alternate solution (which I've not played with in a very long time) 
> could be:
> 
> http://poi.apache.org/
> 
> This could remove the requirement for interacting with a desktop 
> application when dealing with some Microsoft formats.
> 

Thanks, I'll have a look at it (maybe again).
There exist a number of such alternatives. Some are better for some documents, worse for 
others.  And over time, some get better and some get worse (slower development, do not 
keep in sync with new document versions).  We are always on the lookout for the best 
alternative of the moment, and try to structure our applications so that we can switch the 
tools we use without too much fuss.
It is always a bit like walking along quicksands though, because the variety of ways in 
which people manage to screw up real-world documents is amazing; and because in all 
document formats, there is always this "feature creep" which developers seem to be unable 
to stop themselves from falling for.
So you have to spend a considerable amount of time on testing over a large volume of 
documents before you can really accept any tool as "good enough".

All of this to say that using an (MS or other) desktop application is not the way we would 
prefer to do things, but that since it is the reference used by our customers, we are 
sometimes forced to do this.  And since some of these applications do not exist in a 
version that can be used without problems in a Service context, we sometimes have no 
better choice than to run the application using it, as a desktop application itself.

Which after all and roundabout, brings us back to the original OP's question.

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


Re: Console when running as a service.

Posted by Mark Eggers <it...@yahoo.com>.
On 3/11/2013 11:20 AM, André Warnier wrote:
> pid@pidster.com wrote:
>> On 11 Mar 2013, at 14:21, "André Warnier" <aw...@ice-sa.com> wrote:
>>
>>> 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.
>>
>> Eek! Eek I say!
>>
> +1. Eek, I tearfully and shamefully agree.
> But still 90% or more of corporate internal documents are written as
> Word documents, and there is no open-source tool which can perfectly
> handle this shamefully proprietary format and convert it to some
> non-propietary format that one could still read in 10 year's time, so
> what is one to do if one wants to get some money to get one's children
> through computer school and pay for their iPhones, he ?

Sigh, I agree if your constraint is "perfectly" then you're pretty much 
stuck. However, even Microsoft doesn't deal with their formats "perfectly".

An alternate solution (which I've not played with in a very long time) 
could be:

http://poi.apache.org/

This could remove the requirement for interacting with a desktop 
application when dealing with some Microsoft formats.

> But the main point was that there are cases where running as a Service
> is the most appropriate way, and cases where it isn't.  And that modern
> technology often provides a variety of ways to achieve one's goals at
> minimum expense and frustration. And that many times it is not that the
> information on how to do something is not available, it is a matter of
> not knowing where or how to find it among the clutter.  So indicating
> some practical alternatives seemed the right thing to do here.

I know how to do the original request in Eclipse and NetBeans, but I 
don't have a quick handle on how to do this for Tomcat running as a 
Windows service.

There were several hits with a quick search, but since I've not used any 
of the projects I'm a bit reluctant to mention them.

. . . . just my two cents.
/mde/


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


Re: Console when running as a service.

Posted by André Warnier <aw...@ice-sa.com>.
pid@pidster.com wrote:
> On 11 Mar 2013, at 14:21, "André Warnier" <aw...@ice-sa.com> wrote:
> 
>> 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.
> 
> Eek! Eek I say!
> 
+1. Eek, I tearfully and shamefully agree.
But still 90% or more of corporate internal documents are written as Word documents, and 
there is no open-source tool which can perfectly handle this shamefully proprietary format 
and convert it to some non-propietary format that one could still read in 10 year's time, 
so what is one to do if one wants to get some money to get one's children through computer 
school and pay for their iPhones, he ?

But the main point was that there are cases where running as a Service is the most 
appropriate way, and cases where it isn't.  And that modern technology often provides a 
variety of ways to achieve one's goals at minimum expense and frustration. And that many 
times it is not that the information on how to do something is not available, it is a 
matter of not knowing where or how to find it among the clutter.  So indicating some 
practical alternatives seemed the right thing to do here.




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


Re: Console when running as a service.

Posted by pi...@pidster.com.
On 11 Mar 2013, at 14:21, "André Warnier" <aw...@ice-sa.com> wrote:

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

Eek! Eek I say!


p

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


RE: Console when running as a service.

Posted by "Harris, Jeffrey E." <Je...@ManTech.com>.

> -----Original Message-----
> From: André Warnier [mailto:aw@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.

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


This e-mail and any attachments are intended only for the use of the addressee(s) named herein and may contain proprietary information. If you are not the intended recipient of this e-mail or believe that you received this email in error, please take immediate action to notify the sender of the apparent error by reply e-mail; permanently delete the e-mail and any attachments from your computer; and do not disseminate, distribute, use, or copy this message and any attachments.

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


Re: Console when running as a service.

Posted by "Howard W. Smith, Jr." <sm...@gmail.com>.
On Mon, Mar 11, 2013 at 4:33 AM, André Warnier <aw...@ice-sa.com> wrote:

>
> Well, basically it is either the one or the other, can't have your cake
> and eat it, etc..
>

wow, can't have your cake and eat it... that got me cracking up! funny! :)


>
> 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.
>
>
On Windows Server 2003 and 2008, I use TextPad (which is a really great
file editor, similar to Multi-Edit, which I previously used many years ago
in the past). Anyway, TextPad always informs me when a file (that I'm
currently viewing in TextPad) has been updated, and then prompts me to load
the newly-updated file.


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

Interesting. this is good to know.

Re: Console when running as a service.

Posted by André Warnier <aw...@ice-sa.com>.
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.

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.

HTH.

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