Log rotation

Lists: pgsql-admin
From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Log rotation
Date: 2002-03-28 18:54:15
Message-ID: 009d01c1d689$f5878ed0$5ce8fea9@GMENDOLA2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Hi to all,

I configured the log rotation of postgresql started in this way:

su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
/usr/bin/postmaster start > /var/log/postgresql.log 2>&1" < /dev/null

with the log rotate file:

/var/log/postgresql.log {
compress
rotate 5
size=10000k
create 0664 postgres postgres
daily
sharedscripts
copytruncate
}

the problem now is that the postgres server is really
stressed and write continuosly on the log file
and the file is not truncated!!!!!

anyone have any idea??

Ciao
Gaetano

--
#exclude <windows>
#include <CSRSS>
printf("\t\t\b\b\b\b\b\b");.
printf("\t\t\b\b\b\b\b\b");


From: Andre Schubert <andre(dot)schubert(at)km3(dot)de>
To: Gaetano Mendola <mendola(at)bigfoot(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Log rotation
Date: 2002-04-02 04:54:30
Message-ID: 3CA93986.C721718E@km3.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Gaetano Mendola schrieb:
>
> Hi to all,
>
> I configured the log rotation of postgresql started in this way:
>
> su -l postgres -s /bin/sh -c "/usr/bin/pg_ctl -D $PGDATA -p
> /usr/bin/postmaster start > /var/log/postgresql.log 2>&1" < /dev/null
>
> with the log rotate file:
>
> /var/log/postgresql.log {
> compress
> rotate 5
> size=10000k
> create 0664 postgres postgres
> daily
> sharedscripts
> copytruncate
> }
>
> the problem now is that the postgres server is really
> stressed and write continuosly on the log file
> and the file is not truncated!!!!!
>
> anyone have any idea??

You can use multilog on linux.


From: "Gaetano Mendola" <mendola(at)bigfoot(dot)com>
To: "Andre Schubert" <andre(dot)schubert(at)km3(dot)de>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Log rotation
Date: 2002-04-03 09:20:31
Message-ID: 008e01c1daf0$cd683790$5ce8fea9@GMENDOLA2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

"Andre Schubert" <andre(dot)schubert(at)km3(dot)de> wrote:
> You can use multilog on linux.

Hi, I don't know what's multilog but I resolved my
problem in this way (general suggestions for all):

#File postgresql.conf

syslog = 2
syslog_facility = 'LOCAL0'
syslog_ident = 'postgres'

#File /etc/logrotate.d/postgres

/var/log/postgresql.log {
compress
rotate 5
size=10000k
errors mendola(at)bigfoot(dot)com
create 0664 postgres postgres
daily
postrotate
/usr/bin/killall -HUP syslogd
endscript
}

#In File syslog.conf
LOCAL0.*
/var/log/postgresql.log

Ciao
Gaetano

--
#exclude <windows>
#include <CSRSS>
printf("\t\t\b\b\b\b\b\b");.
printf("\t\t\b\b\b\b\b\b");


From: Andre Schubert <andre(dot)schubert(at)km3(dot)de>
To: Gaetano Mendola <mendola(at)bigfoot(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Log rotation
Date: 2002-04-04 10:08:23
Message-ID: 3CAC2617.DE94CACF@km3.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Gaetano Mendola schrieb:
>
> "Andre Schubert" <andre(dot)schubert(at)km3(dot)de> wrote:
> > You can use multilog on linux.
>
> Hi, I don't know what's multilog but I resolved my
> problem in this way (general suggestions for all):

multilog does exactly the same as logrotate, but it is a process itself.
we you it this way:
su -l postgres -c "/usr/bin/pg_ctl ....' start 2>&1 | /usr/bin/multilog
s16777215 n20 '/var/log/psql' &" < /dev/null

Everything coming from postgres is piped through multilog and multilog
creates logfiles in the directory
/var/log/pgsql. Each logfile is 16777215 bytes big, and there are max 20
logfiles.
There should be a multilog-rpms somewhere for linux.
Hope this also helps.

Regards

>
> #File postgresql.conf
>
> syslog = 2
> syslog_facility = 'LOCAL0'
> syslog_ident = 'postgres'
>
> #File /etc/logrotate.d/postgres
>
> /var/log/postgresql.log {
> compress
> rotate 5
> size=10000k
> errors mendola(at)bigfoot(dot)com
> create 0664 postgres postgres
> daily
> postrotate
> /usr/bin/killall -HUP syslogd
> endscript
> }
>
> #In File syslog.conf
> LOCAL0.*
> /var/log/postgresql.log
>
> Ciao
> Gaetano
>
> --
> #exclude <windows>
> #include <CSRSS>
> printf("\t\t\b\b\b\b\b\b");.
> printf("\t\t\b\b\b\b\b\b");
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org