Re: rotate catalina.out without restart?

2016-02-02 Thread Harald Dunkel
Hi Christopher,

On 02/01/2016 05:07 PM, Christopher Schultz wrote:
> Harald,
> 
> On 2/1/16 10:42 AM, Harald Dunkel wrote:
>> would it be possible to integate apache's rotatelogs into
>> catalina.sh to support daily rotation of catalina.out without
>> restart?
> 
> Nope.
> 

:-(.

>> This would be #1 on my wish list for version 9.
> 
> If you use the Tomcat startup scripts, the shell is responsible for
> output redirection. Hacking that to pipe-through an external program
> (eg. chronolog, etc.) is possible but makes the scripts very complicated
> .

OK, then the question is why does catalina.sh write to catalina.out
at all? stdout/stderr of the script would be sufficient. Writing to
a hard wired log file without rotation is the worst option of all
(even if you can choose the file name).

> 
> If you want to rotate stdout/stderr logs, you should use jsvc or some
> other service-runner; they will know how to rotate those files. For
> example, jsvc can rotate those files when it receives a signal.
> 

Will this make catalina.out obsolete?


Regards
Harri

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



RE: rotate catalina.out without restart?

2016-02-02 Thread Caldarale, Charles R
> From: Harald Dunkel [mailto:harald.dun...@aixigo.de] 
> Subject: Re: rotate catalina.out without restart?

> OK, then the question is why does catalina.sh write to catalina.out
> at all? stdout/stderr of the script would be sufficient.

And where would you have the output go when Tomcat is run as a service?  The 
redirection to catalina.out is there not for the benefit of the script, but 
rather to handle sloppily-written webapps that dump things into stdout or 
stderr rather than using a logger.  If you want to eliminate writing to 
catalina.out, set swallowOutput to true in the  elements of the 
offending (and offensive) webapps.

 - 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-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: rotate catalina.out without restart?

2016-02-02 Thread RAY, DAVID

> From: Harald Dunkel [mailto:harald.dun...@aixigo.de] 
> Subject: Re: rotate catalina.out without restart?

> OK, then the question is why does catalina.sh write to catalina.out
> at all? stdout/stderr of the script would be sufficient.

>And where would you have the output go when Tomcat is run as a service?  The 
>redirection to catalina.out is there not for the benefit of the script, but 
>rather to handle sloppily->written webapps that dump things into stdout or 
>stderr rather than using a logger.  If you want to eliminate writing to 
>catalina.out, set swallowOutput to true in the  >elements of the 
>offending (and offensive) webapps.

 >- Chuck


Did you not read his response CHUCK???   He just told you.  I quote:  " 
stdout/stderr of the script would be sufficient"   Not that I have an opinion 
one way or the other.  Just pointing out the obvious.



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


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



Re: rotate catalina.out without restart?

2016-02-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Harald,

On 2/2/16 3:06 AM, Harald Dunkel wrote:
> Hi Christopher,
> 
> On 02/01/2016 05:07 PM, Christopher Schultz wrote:
>> Harald,
>> 
>> On 2/1/16 10:42 AM, Harald Dunkel wrote:
>>> would it be possible to integate apache's rotatelogs into 
>>> catalina.sh to support daily rotation of catalina.out without 
>>> restart?
>> 
>> Nope.
>> 
> 
> :-(.
> 
>>> This would be #1 on my wish list for version 9.
>> 
>> If you use the Tomcat startup scripts, the shell is responsible
>> for output redirection. Hacking that to pipe-through an external
>> program (eg. chronolog, etc.) is possible but makes the scripts
>> very complicated .
> 
> OK, then the question is why does catalina.sh write to
> catalina.out at all? stdout/stderr of the script would be
> sufficient. Writing to a hard wired log file without rotation is
> the worst option of all (even if you can choose the file name).

When you run "bin/catalina.sh start" you are implicitly requesting
your stdout/stderr be redirected. If you don't want that to happen,
don't run it that way.

Try this:

$ bin/catalina.sh start | whatever_you_want

>> If you want to rotate stdout/stderr logs, you should use jsvc or
>> some other service-runner; they will know how to rotate those
>> files. For example, jsvc can rotate those files when it receives
>> a signal.
>> 
> 
> Will this make catalina.out obsolete?

If you use jsvc, catalina.out is not a factor at all. The state of its
obsolescence is up to you.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlawupMACgkQ9CaO5/Lv0PDuVACgo8NsBHw1sSvF9VZHB8O4+wIJ
314AnAspyFr8IEMyLlBc+0Pz/+Zoh/bw
=b8e0
-END PGP SIGNATURE-

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



Re: rotate catalina.out without restart?

2016-02-01 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Harald,

On 2/1/16 10:42 AM, Harald Dunkel wrote:
> would it be possible to integate apache's rotatelogs into
> catalina.sh to support daily rotation of catalina.out without
> restart?

Nope.

> This would be #1 on my wish list for version 9.

If you use the Tomcat startup scripts, the shell is responsible for
output redirection. Hacking that to pipe-through an external program
(eg. chronolog, etc.) is possible but makes the scripts very complicated
.

If you want to rotate stdout/stderr logs, you should use jsvc or some
other service-runner; they will know how to rotate those files. For
example, jsvc can rotate those files when it receives a signal.

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlavgtcACgkQ9CaO5/Lv0PBzogCffGyiTvRD2KmYsu45t9q/n1w9
U9cAnjGidN7YfcwiDnU4JCvHnCBUhmSD
=1VN9
-END PGP SIGNATURE-

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



Re: rotate catalina.out without restart?

2016-02-01 Thread Rainer Frey (Inxmail GmbH)

> On 01.02.2016, at 16:42, Harald Dunkel  wrote:
> 
> Hi folks,
> 
> would it be possible to integate apache's rotatelogs
> into catalina.sh to support daily rotation of catalina.out
> without restart?

On linux, (system) logrotate ha a “copytruncate” option that could be used.
You’d need to check whether that could lose some log lines though - and if 
you could live with that.

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