Re: Postgres logs w/ Logrotate
От | Renê Salomão |
---|---|
Тема | Re: Postgres logs w/ Logrotate |
Дата | |
Msg-id | 20030402110541.756043a3.rene@ibiz.com.br обсуждение исходный текст |
Ответ на | Re: Postgres logs w/ Logrotate (Oliver Elphick <olly@lfix.co.uk>) |
Ответы |
Re: Postgres logs w/ Logrotate
|
Список | pgsql-novice |
Oliver, Thank u very much... Copytruncate was exactly what my scripts was missing.. Just had to replace copytruncate with create... I lacked the knowledge that postmaster does not close the file... By the way is there any environment variable to log path? I know that there is for data (PGDATA) and port (PGPORT)... What about log (PGLOG)? Would help a lot if such variable exists!!! The reason is that anyone here can start/stop/reload our testing database, most of the time people forget about setting log file... Thanks... On 31 Mar 2003 22:24:48 +0100 Oliver Elphick <olly@lfix.co.uk> wrote: > On Fri, 2003-03-28 at 14:35, Renê Salomão wrote: > > Hi list, > > > > Is there any extra configuration to run postgresql 7.3.2 logs > > with logrotate? > > I tried the following script at /etc/logrotate.d: > > > > /var/log/postgresql/postgresql.log { > > daily > > rotate 5 > > compress > > create > > } > > > > the problem is that after it does its first rotation (create a > > compressed copy of the log) and the new log file created, any new > > message originated from postgresql is not saved in log file... > > > > I do start postgres with: > > > > pg_ctl start -o -i -l /var/log/postgresql/postgresql.log > > > > > > What am I doing wrong? Does Postgresql need to be restarted? How > > can I > > do it? > > You probably need the copytruncate option in your logrotate script. > The postmaster does not close its logfile, so it continues to write to > the file you have rotated out. > > -- > Oliver Elphick > Oliver.Elphick@lfix.co.uk Isle of Wight, UK > http://www.lfix.co.uk/oliver > GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D > 0C1C > ======================================== > "If we confess our sins, he is faithful and just to > forgive us our sins, and to cleanse us from all > unrighteousness." I John 1:9 > > ----------------------------- Renê Salomão Ibiz Tecnologia -- www.ibiz.com.br (011) 5579-3178 - R. 211
В списке pgsql-novice по дате отправления: