Plan B for log rotation support: borrow Apache code

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Plan B for log rotation support: borrow Apache code
Date: 2003-05-23 19:13:36
Message-ID: 17866.1053717216@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Something we've discussed repeatedly is adding a log rotation program to
the distribution so that we don't have to hand-wave in the part of the
documentation that talks about setting up non-syslog-based logging.
A few weeks ago Andrew Sullivan offered the rotator his company uses,
but there were various objections to it (mainly that it couldn't coexist
with pg_ctl, IIRC).

I think a reasonable Plan B is to borrow Apache's rotatelogs program
hook, line, and sinker, and include it as a contrib module. It's small
and it does exactly what we want: read stdin and drop it into a series
of text files. The license can be read at
http://www.apache.org/LICENSE.txt
It's essentially BSD terms; I think all we would need to do differently
from what we'd do with homegrown code is include the text of the Apache
license in the README.rotatelogs documentation file that the contrib
module would install.

It would take an hour or two's work to put together a standalone version
of rotatelogs.c (one that doesn't depend on the Apache Portable Runtime
library). Seems well worth it to me. Does anyone have an objection to
doing this?

regards, tom lane


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Plan B for log rotation support: borrow Apache code
Date: 2003-05-23 22:37:41
Message-ID: 24987.1053729461@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> Or we could take the one I posted, which does exactly the same thing as
> Apache's (at least about a year ago, not sure where the APR plays in
> nowadays), thus shortcircuiting that porting effort.

I'd forgotten that one. Where is it again?

regards, tom lane


From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Plan B for log rotation support: borrow Apache code
Date: 2003-05-23 22:38:26
Message-ID: Pine.LNX.4.44.0305240036580.5719-100000@peter.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane writes:

> It would take an hour or two's work to put together a standalone version
> of rotatelogs.c (one that doesn't depend on the Apache Portable Runtime
> library). Seems well worth it to me. Does anyone have an objection to
> doing this?

Or we could take the one I posted, which does exactly the same thing as
Apache's (at least about a year ago, not sure where the APR plays in
nowadays), thus shortcircuiting that porting effort.

--
Peter Eisentraut peter_e(at)gmx(dot)net


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Plan B for log rotation support: borrow Apache code
Date: 2003-05-24 01:30:02
Message-ID: 200305240130.h4O1U2G26210@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Or we could take the one I posted, which does exactly the same thing as
> > Apache's (at least about a year ago, not sure where the APR plays in
> > nowadays), thus shortcircuiting that porting effort.
>
> I'd forgotten that one. Where is it again?

I just bounced it the hackers list. It has an April date.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Plan B for log rotation support: borrow Apache code
Date: 2003-05-24 01:33:52
Message-ID: 200305240133.h4O1Xq326394@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Here are the log scripts posted by Andrew Sullivan and Peter E.

---------------------------------------------------------------------------

Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> > Or we could take the one I posted, which does exactly the same thing as
> > Apache's (at least about a year ago, not sure where the APR plays in
> > nowadays), thus shortcircuiting that porting effort.
>
> I'd forgotten that one. Where is it again?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

Attachment Content-Type Size
unknown_filename text/plain 2.9 KB
unknown_filename text/plain 2.3 KB

From: "Andrew Dunstan" <andrew(at)dunslane(dot)net>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Plan B for log rotation support: borrow Apache code
Date: 2003-05-24 13:22:02
Message-ID: 002b01c321f7$77174bc0$6401a8c0@DUNSLANE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Plan B.0.1 might be to get the version of rotatelogs.c from the Apache 1.3
branch so that removing the APR stuff wasn't necessary (IIRC APR is a purely
2.x thing in Apache).

Can be viewed here:
http://cvs.apache.org/viewcvs.cgi/apache-1.3/src/support/rotatelogs.c

Or else use the one from Peter, I don't care, just pointing out that
removing APR shouldn't be necessary.

andrew (big fan of not reinventing the wheel - good programmers write code,
great programmers steal code ;-)

----- Original Message -----
From: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: <pgsql-hackers(at)postgresql(dot)org>
Sent: Friday, May 23, 2003 3:13 PM
Subject: [HACKERS] Plan B for log rotation support: borrow Apache code

> Something we've discussed repeatedly is adding a log rotation program to
> the distribution so that we don't have to hand-wave in the part of the
> documentation that talks about setting up non-syslog-based logging.
> A few weeks ago Andrew Sullivan offered the rotator his company uses,
> but there were various objections to it (mainly that it couldn't coexist
> with pg_ctl, IIRC).
>
> I think a reasonable Plan B is to borrow Apache's rotatelogs program
> hook, line, and sinker, and include it as a contrib module. It's small
> and it does exactly what we want: read stdin and drop it into a series
> of text files. The license can be read at
> http://www.apache.org/LICENSE.txt
> It's essentially BSD terms; I think all we would need to do differently
> from what we'd do with homegrown code is include the text of the Apache
> license in the README.rotatelogs documentation file that the contrib
> module would install.
>
> It would take an hour or two's work to put together a standalone version
> of rotatelogs.c (one that doesn't depend on the Apache Portable Runtime
> library). Seems well worth it to me. Does anyone have an objection to
> doing this?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org