Thread: log rotation script for server output

log rotation script for server output

From
Flower Sun
Date:

Hi, group,

Does any one of you write log rotation script for postgresql server output? Can you share with us?

shell> pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/logfiles/activity.log -o -i

Thank you

 



Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

Re: log rotation script for server output

From
Bruno Wolff III
Date:
On Tue, Mar 25, 2003 at 12:32:53 -0800,
  Flower Sun <sun_2002_flower@yahoo.com> wrote:
>
> Hi, group,
>
> Does any one of you write log rotation script for postgresql server output? Can you share with us?
>
> shell> pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/logfiles/activity.log -o -i

You can pipe the output into multilog (from DJB's daemontools package).


Re: log rotation script for server output

From
"scott.marlowe"
Date:
On Tue, 25 Mar 2003, Flower Sun wrote:

>
> Hi, group,
>
> Does any one of you write log rotation script for postgresql server output? Can you share with us?
>
> shell> pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/logfiles/activity.log -o -i

I use rotatelogs from the apache package.  Make sure it's in the postgres
super user's path, create a directory for the logs that the postgres
user can write to (I use $PGDATA/pglog here) then put this line in
rc.local:

su - postgres -c 'pg_ctl start | rotatelogs $PGDATA/pglog 86400 2>1&'

Note that that's apache 1.3.x.  I haven't really had time or a need to
look at 2.x apache yet.


Re: log rotation script for server output

From
Medi Montaseri
Date:
I use logrotate-3.6.5-2.rpm on a red hat with the following config file

/var/log/pglog
{
        rotate 2
        size=1M
        copytruncate
        delaycompress
        compress
}


Just to show how flexiable this logrotator is...

But the official word is that let syslog handle it....

Bruno Wolff III wrote:

>On Tue, Mar 25, 2003 at 12:32:53 -0800,
>  Flower Sun <sun_2002_flower@yahoo.com> wrote:
>
>
>>Hi, group,
>>
>>Does any one of you write log rotation script for postgresql server output? Can you share with us?
>>
>>shell> pg_ctl start -D /var/lib/pgsql/data -l /var/lib/pgsql/logfiles/activity.log -o -i
>>
>>
>
>You can pipe the output into multilog (from DJB's daemontools package).
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 3: if posting/reading through Usenet, please send an appropriate
>subscribe-nomail command to majordomo@postgresql.org so that your
>message can get through to the mailing list cleanly
>
>


Re: log rotation script for server output

From
Bruno Wolff III
Date:
On Tue, Mar 25, 2003 at 14:21:37 -0800,
  Flower Sun <sun_2002_flower@yahoo.com> wrote:
>
> Hi, Bruno,
> Thank you very much for your reply. Can you give me more information about DJB's daemontools?

The package is at:
http://cr.yp.to/daemontools.html
There is documentation there about how to use it.
You can just use multilog by piping the output from postmaster through it
or you can even run postgres using daemontools instead of using init.
I am currently using daemontools to run postgres and using multilog for
logging.