"André Warnier" <a...@ice-sa.com> wrote:
>Christopher Schultz wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>> 
>> André,
>> 
>> On 10/25/13, 7:18 AM, André Warnier wrote:
>>> For example, a utility such as logrotate, in the sysadmin world, is
>>> like a gift of God. Most server-like programs allow logrotate to
>>> rotate their logfiles, compress old ones, remove even older ones,
>>> etc. to keep things running smoothly over time. It's a simple
>>> thing, but it saves many hours that would otherwise have to be
>>> dedicated to monitoring and reacting to such repetitive
>>> occurrences.
>>>
>>> Tomcat, at this moment, does not really allow that.
>> 
>> It does, but it's not terribly obvious how to do it.
>> 
>> Here are some ways to do it:
>> 
>> 1. Modify catalina.sh to pipe | instead of redirect >
>> 2. Use "catalina.sh start | chronolog" or whatever
>> 3. Configure logrotate to copy-and-truncate
>> 4. Set CATALINA_OUT=/dev/null before launching
>> 5. Set up a named pipe and set CATALINA_OUT to it before launching
>>    (Plus have another process drain that pipe)
>> 
>>> That is because there is no simple mechanism to tell Tomcat to 
>>> relinquish control of its current logfiles for a moment, short of 
>>> stopping Tomcat completely and restarting it (which interrupts the 
>>> service, sometimes for a significant amount of time).
>> 
>> What happens in httpd if I write a module that writes to stdout
>> instead of the proper httpd-provided logging mechanisms?
>
>The module's stdout/stderr is redirected to the Apache error log.
>
>> 
>>> So my request is simple (at least to express) : can someone among
>>> the Tomcat luminaries not imagine a mechanism by which Tomcat
>>> would, on request from an external program or script, do something
>>> like the Apache httpd does during a "soft reload" : wait for the
>>> current requests to terminate, close all logfiles and re-open them
>>> ? For example : there already exist a "shutdown port", and a bunch
>>> of "Listeners". Could there not be a "logs rotate port" or a
>>> "logrotate listener" ?
>> 
>> It seems like this could be done via the manager webapp.
>> 
>>> I am not underestimating the possible difficulty of the task, and 
>>> probably tackling such an issue is ultimately less rewarding for a 
>>> developer than implementing the latest in webapp or HTTP
>>> technology.
>>>
>>> But many sysadmins worldwide would be grateful if this came to pass
>>> and I am sure that it would do a great deal to increase the
>>> popularity of Tomcat among them.
>> 
>> Honestly, the only time this is really a problem is when catalina.out
>> is filling-up with junk, right? It's always awkward when that
>happens.
>> 
>
>Yes, but the point is : the sysadmins do not generally control the code
>of the webapps.
>They are just told to run them. And there are a lot of webapps that
>write to stdout. 
>That's precisely the case of the last OP who posted about this.  But
>not only /his/ 
>problem, by any means.


Would this help solve the problem?
https://issues.apache.org/bugzilla/show_bug.cgi?id=53930

If so, the number of votes for an enhancement is one of the factors I take into 
account when trying to figure out which enhancement request to look at next.

Mark


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

Reply via email to