You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Andrew Ford <an...@icarus.demon.co.uk> on 1999/12/16 22:55:38 UTC

reworking of cronolog as mod_cronolog (or folding into mod_log_config)

I wrote a log rotation program called cronolog a couple of years ago.
It reads log messages from its input and writes them out to a log file
that is rotated according to a filename template, defined
using strftime specifiers.  Thus the directive

	TransferLog "|/usr/local/sbin/cronolog '/var/logs/httpd/%Y-%m-%d.log'"

would write to a sequence of log files, one per day.

I have offered cronolog to the Apache project before and the offer
still stands, but also I have had a number of requests to rework
cronolog as an Apache module.  The idea seems logical to me and it
would fit neatly into the existing syntax.  That is if the log
filename (for TransferLog, ErrorLog or CustomLog) contained '%'
characters, but did not start with a vertical bar, it would be treated 
as a filename template for rotating log files.  Folding into Apache
would avoid the overhead of having multiple cronolog processes on busy 
sites.

What do people think of the idea (and that of the cronolog program being
taken into the corpus of contributed software).  Currently cronolog is 
covered by either the GPL or Artistic license, but I would be happy to 
assign copyright to the Apache Group and have it covered by the Apache 
license.

The URL for cronolog is: http://www.ford-mason.co.uk/resources/cronolog/ 

Regards
Andrew
-- 
Andrew Ford                  Ford & Mason Ltd           +44 1531 829900 (tel)
A.Ford@ford-mason.co.uk      South Wing, Compton House  +44 1531 829901 (fax)
http://www.ford-mason.co.uk  Compton Green, Redmarley   +44 385 258278 (mobile)
http://www.refcards.com      Gloucester, GL19 3JB, UK   

Re: reworking of cronolog as mod_cronolog (or folding into mod_l

Posted by Scott Hess <sc...@avantgo.com>.
As I understand cronolog, it tries to log lines perfectly to logs for the
appropriate time periods (based on the beginning of the request, or the
end?  Makes little difference, I suppose).  So sending a SIGUSR1 might
result in a few lines sneaking from the previous day's logs to the next.

If a cronolog module wants to be able to "perfectly" split across logs
based on time, the parent could open two logfiles (one for the current
period, one for the next period), then the children could internally switch
to the next logfile at the appropriate time.  After the next period begins,
a SIGUSR1 to the parent should work to progress forward to the next
logfile.

Later,
scott

----- Original Message -----
From: Martin Kraemer <Ma...@Mch.SNI.De>
To: <ne...@apache.org>
Sent: Monday, December 20, 1999 8:19 AM
Subject: Re: reworking of cronolog as mod_cronolog (or folding into mod_l


> On Sun, Dec 19, 1999 at 08:43:31PM +0100, Martin Kraemer wrote:
> > I can only decide about it when I know how the ownership will be
handled.
> > +1 if nothing changes against the current situation (except for the
added
> > functionality).
>
> I imagine that the reopening of the logfiles could be limited to the
> point(s) in time where the server is restarted. Simply sending a SIGUSR1
> at midnight would automatically rotate "per day" (combined with the
> modifications of mod_log_config, and an appropriate configuration) or
> per month or whatever.
>
>     Martin
> --
>   <Ma...@MchP.Siemens.De>      |       Fujitsu Siemens
>        <ma...@apache.org>              |   81730  Munich,  Germany


Re: reworking of cronolog as mod_cronolog (or folding into mod_l

Posted by Martin Kraemer <Ma...@Mch.SNI.De>.
On Sun, Dec 19, 1999 at 08:43:31PM +0100, Martin Kraemer wrote:
> I can only decide about it when I know how the ownership will be handled.
> +1 if nothing changes against the current situation (except for the added
> functionality).

I imagine that the reopening of the logfiles could be limited to the
point(s) in time where the server is restarted. Simply sending a SIGUSR1
at midnight would automatically rotate "per day" (combined with the
modifications of mod_log_config, and an appropriate configuration) or
per month or whatever.

    Martin
-- 
  <Ma...@MchP.Siemens.De>      |       Fujitsu Siemens
       <ma...@apache.org>              |   81730  Munich,  Germany

Re: reworking of cronolog as mod_cronolog (or folding into mod_l

Posted by Martin Kraemer <Ma...@Mch.SNI.De>.
On Sat, Dec 18, 1999 at 02:29:43PM +0100, Lars Eilebrecht wrote:
> 
> +1 to add cronolog (as a program not as module) for 1.3.10.
> How about extending mod_log_config with the cronolog features for 2.0?

I can only decide about it when I know how the ownership will be handled.
+1 if nothing changes against the current situation (except for the added
functionality).

    Martin
-- 
  <Ma...@MchP.Siemens.De>      |       Fujitsu Siemens
       <ma...@apache.org>              |   81730  Munich,  Germany

Re: reworking of cronolog as mod_cronolog (or folding into mod_l

Posted by Lars Eilebrecht <la...@hyperreal.org>.
According to Manoj Kasichainula:

>  On Fri, Dec 17, 1999 at 02:27:27PM +0100, Martin Kraemer wrote:
> > So, if we HAVE a logresolve, there's no additional "bundling a bunch
> > of stuff".
>  [...]
> > But I'm
> >     +2
> > for replacing logresolve by cronolog ASAP.
>  
>  You've convinced me. +1 
>  -- 
>  Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/

+1 to add cronolog (as a program not as module) for 1.3.10.
How about extending mod_log_config with the cronolog features for 2.0?


ciao...
-- 
Lars Eilebrecht                     - I really don't think...
lars@hyperreal.org            - that these signatures are random...


Re: reworking of cronolog as mod_cronolog (or folding into mod_log_config)

Posted by Manoj Kasichainula <ma...@io.com>.
On Fri, Dec 17, 1999 at 02:27:27PM +0100, Martin Kraemer wrote:
> So, if we HAVE a logresolve, there's no additional "bundling a bunch
> of stuff".
[...]
> But I'm
>     +2
> for replacing logresolve by cronolog ASAP.

You've convinced me. +1 
-- 
Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/

Re: reworking of cronolog as mod_cronolog (or folding into mod_log_config)

Posted by Martin Kraemer <Ma...@Mch.SNI.De>.
On Thu, Dec 16, 1999 at 05:53:16PM -0600, Manoj Kasichainula wrote:
> On Thu, Dec 16, 1999 at 09:55:38PM +0000, Andrew Ford wrote:
> > I have offered cronolog to the Apache project before and the offer
> > still stands
> 
> It actually seems reasonable as an addition for 2.0. I personally
> don't see any advantage to bundling a bunch of stuff into the Apache
> tarball, but other people do.

!? We already have a logresolve in our distribution, and to be honest,
it's not very good:
*  No easy way to locate the actual log filename;
*  not even a predictable log file name (like "./1999/12/17/access_log"
   or "./access_1999-Dec-17.log");
*  no constant name (like "access_log") which is automatically
   pointing to the current actual name;
really no easy task for log file analyzers to find whatever
logresolve spits out.

So, if we HAVE a logresolve, there's no additional "bundling a bunch
of stuff". And  it could be improved, because cronolog painlessly
does all which I criticized above.

> > What do people think of the idea (and that of the cronolog program being
> > taken into the corpus of contributed software).

Like Manoj, I don't see how the log file rotation would be handled
within apache with an embedded cronolog code.
But I'm
    +2
for replacing logresolve by cronolog ASAP.

    Martin
-- 
  <Ma...@MchP.Siemens.De>      |       Fujitsu Siemens
       <ma...@apache.org>              |   81730  Munich,  Germany

Re: reworking of cronolog as mod_cronolog (or folding into mod_log_config)

Posted by Manoj Kasichainula <ma...@io.com>.
On Thu, Dec 16, 1999 at 09:55:38PM +0000, Andrew Ford wrote:
> I have offered cronolog to the Apache project before and the offer
> still stands

It actually seems reasonable as an addition for 2.0. I personally
don't see any advantage to bundling a bunch of stuff into the Apache
tarball, but other people do.

> but also I have had a number of requests to rework
> cronolog as an Apache module.  The idea seems logical to me and it
> would fit neatly into the existing syntax.  That is if the log
> filename (for TransferLog, ErrorLog or CustomLog) contained '%'
> characters, but did not start with a vertical bar, it would be treated 
> as a filename template for rotating log files.

Wouldn't that mean that the children would be responsible for opening
log files when they get "rotated"? Sounds dangerous; any break-in to
an httpd child process would mean that the log files are also
accessible.

> Folding into Apache would avoid the overhead of having multiple
> cronolog processes on busy sites.

OK, I'm not very familiar with the logging code, but I thought that
there was only a single process started by the piped logger, because
it's started and restarted in the parent. But no matter what, I still
wouldn't think the cronolog process would be that CPU-intensive.

> What do people think of the idea (and that of the cronolog program being
> taken into the corpus of contributed software).

I'll be the substitute-Dean here; I like the componentization that
piped logs give us and prefer them to adding extra code to the logging
modules to handle all the cases people are interested in.

I am far more worried about the security problems this could cause,
though.

> Currently cronolog is covered by either the GPL or Artistic license,
> but I would be happy to assign copyright to the Apache Group and
> have it covered by the Apache license.

Sounds interesting to me, assuming other people that have contributed
to your code but not assigned copyright have done the same.

-- 
Manoj Kasichainula - manojk at io dot com - http://www.io.com/~manojk/

Re: reworking of cronolog as mod_cronolog (or folding into mod_log_config)

Posted by Andrew Ford <an...@icarus.demon.co.uk>.
andrew@icarus.demon.co.uk (Andrew Ford) writes:

> Martin.Kraemer@Mch.SNI.De (Martin Kraemer) writes:
> 
> > On Thu, Dec 16, 1999 at 09:55:38PM +0000, Andrew Ford wrote:
> > > I have offered cronolog to the Apache project before and the offer
> > > still stands, [...]
> > 
> > You've got three +1's!
> > > 
> > > What do people think of the idea (and that of the cronolog program being
> > > taken into the corpus of contributed software).  Currently cronolog is 
> > > covered by either the GPL or Artistic license, but I would be happy to 
> > > assign copyright to the Apache Group and have it covered by the Apache 
> > > license.
> > 
> > Please do so, and I'll be happy to commit it (at least if it doesn't
> > contain any other GPL'ed code). Thanks for your offer!
> 
> I'll replace the GPL and Artistic licenses with the Apache license
> (tomorrow) and put up a 1.6.1 version of cronolog on
> 
> 	http://www.ford-mason.co.uk/resources/cronolog/
> 
> You can then download it from there and commit it.

Version 1.6.1 of cronolog is now on www.ford-mason.co.uk with Apache
license and copyright assigned to the Apache Software Foundation.

Andrew
-- 
Andrew Ford,  Director       Ford & Mason Ltd           +44 1531 829900 (tel)
A.Ford@ford-mason.co.uk      South Wing, Compton House  +44 1531 829901 (fax)
http://www.ford-mason.co.uk  Compton Green, Redmarley   +44 385 258278 (mobile)
http://www.refcards.com      Gloucester, GL19 3JB, UK   

Re: reworking of cronolog as mod_cronolog (or folding into mod_log_config)

Posted by Andrew Ford <an...@icarus.demon.co.uk>.
Martin.Kraemer@Mch.SNI.De (Martin Kraemer) writes:

> On Thu, Dec 16, 1999 at 09:55:38PM +0000, Andrew Ford wrote:
> > I have offered cronolog to the Apache project before and the offer
> > still stands, [...]
> 
> You've got three +1's!
> > 
> > What do people think of the idea (and that of the cronolog program being
> > taken into the corpus of contributed software).  Currently cronolog is 
> > covered by either the GPL or Artistic license, but I would be happy to 
> > assign copyright to the Apache Group and have it covered by the Apache 
> > license.
> 
> Please do so, and I'll be happy to commit it (at least if it doesn't
> contain any other GPL'ed code). Thanks for your offer!

I'll replace the GPL and Artistic licenses with the Apache license
(tomorrow) and put up a 1.6.1 version of cronolog on

	http://www.ford-mason.co.uk/resources/cronolog/

You can then download it from there and commit it.

The only patches I've had for cronolog have literally affected only
one or two lines, so I believe the current ownership of the code rests
firmly with Ford & Mason Ltd, and we can legitimately donate it to the
Apache Software Foundation.  There are copies of getopt and strptime
from the GNU C library in the lib subdirectory for systems without
these functions, but that directory could be removed from the
distribution.

Regards
Andrew
-- 
Andrew Ford,  Director       Ford & Mason Ltd           +44 1531 829900 (tel)
A.Ford@ford-mason.co.uk      South Wing, Compton House  +44 1531 829901 (fax)
http://www.ford-mason.co.uk  Compton Green, Redmarley   +44 385 258278 (mobile)
http://www.refcards.com      Gloucester, GL19 3JB, UK   

Re: reworking of cronolog as mod_cronolog (or folding into mod_log_config)

Posted by Martin Kraemer <Ma...@Mch.SNI.De>.
On Thu, Dec 16, 1999 at 09:55:38PM +0000, Andrew Ford wrote:
> I have offered cronolog to the Apache project before and the offer
> still stands, [...]

You've got three +1's!
> 
> What do people think of the idea (and that of the cronolog program being
> taken into the corpus of contributed software).  Currently cronolog is 
> covered by either the GPL or Artistic license, but I would be happy to 
> assign copyright to the Apache Group and have it covered by the Apache 
> license.

Please do so, and I'll be happy to commit it (at least if it doesn't
contain any other GPL'ed code). Thanks for your offer!

    Martin
-- 
  <Ma...@MchP.Siemens.De>      |       Fujitsu Siemens
       <ma...@apache.org>              |   81730  Munich,  Germany