[pgpool-general: 5974] Re: pgpool.log rotation

Mariel Cherkassky mariel.cherkassky at gmail.com
Mon Mar 5 18:25:35 JST 2018


Hi,
I used the next command to start the pool and to start the log rotation :
pgpool -n 2>&1 | /usr/sbin/rotatelogs -l -f
/PostgreSQL/pgpool/log/pgpool.log.%A 86400 &
pgpool started and the log was named : pgpool.log.Wednesday

However, the next day after running this command, a new log is created at
01:11 am but the log is stuck and nothing is written to it. Right now my
logs name is pgpool.log.Thursday and nothing is written to it. A new log is
created but nothing is written to all the logs..


2018-02-20 10:23 GMT+02:00 Tatsuo Ishii <ishii at sraoss.co.jp>:

> > Hi,
> > I have installed pgpool 2 version 3.7.0 . I'm trying to configure log
> > rotation on the pgpool.log but It seems that something wrong. I
> configured
> > in logrotate conf file the parameters :
> >
> > /PostgreSQL/pgpool/log/pgpool.log {
> >
> >         daily
> >
> >         dateext
> >
> >         missingok
> >
> >         compress
> >
> >         notifempty
> >
> >         maxage 7
> >
> >         maxsize 21118320640
> >
> >                 rotate 7
> >
> >                 create 644 postgres postgres
> >
> >                 postrotate
> >
> >         su - postgres -c "~/pgpool/bin/pgpool reload"
> >
> >                 endscript
> >
> > }
> >
> > After the first rotation, an archive is generated but the pool stops
> > writing to the original log. Any idea what can be the reason ?
>
> Because Pgpool-II does not the close log file upon receiving SIGHUP
> (issued by reload).
>
> > If this isnt the way can you recommend how to do rotation on pgpool`s
> log ?
>
> Probably the easiest way to do it is setting log_destination = 'syslog'.
>
> Another way to rotate logs is using Apache's rotatelogs program:
>
> ~/pgpool -n 2>&1 | rotatelogs -f -n 3 > /PostgreSQL/pgpool/log/pgpool.log
> 10M
>
> Will create and rotate pgpool.log, pgpool.log.1, pgpool.log.2 under
> /PostgreSQL/pgpool/log every time current log file exceeds 10M.
>
> I think you could use logrotate if you have a program which reads the
> log stream from stdin and write out it to specified file. Also it
> needs to accept some signals (for example SIGHUP) then close and open
> the log file. Perhaps it is not terribly hard to create such that
> program. Or even there's already such a program but I don't know.
>
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20180305/e053b455/attachment.html>


More information about the pgpool-general mailing list