<div dir="rtl"><div dir="ltr">Hi,</div><div dir="ltr">I used the next command to start the pool and to start the log rotation : </div><div dir="ltr">pgpool -n 2&gt;&amp;1 | /usr/sbin/rotatelogs -l -f /PostgreSQL/pgpool/log/pgpool.log.%A 86400 &amp;<br></div><div dir="ltr">pgpool started and the log was named : pgpool.log.Wednesday</div><div dir="ltr"><br></div><div dir="ltr">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..</div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div dir="ltr">2018-02-20 10:23 GMT+02:00 Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">&gt; Hi,<br>
&gt; I have installed pgpool 2 version 3.7.0 . I&#39;m trying to configure log<br>
&gt; rotation on the pgpool.log but It seems that something wrong. I configured<br>
&gt; in logrotate conf file the parameters :<br>
&gt;<br>
&gt; /PostgreSQL/pgpool/log/pgpool.<wbr>log {<br>
&gt;<br>
&gt;         daily<br>
&gt;<br>
&gt;         dateext<br>
&gt;<br>
&gt;         missingok<br>
&gt;<br>
&gt;         compress<br>
&gt;<br>
&gt;         notifempty<br>
&gt;<br>
&gt;         maxage 7<br>
&gt;<br>
&gt;         maxsize 21118320640<br>
&gt;<br>
&gt;                 rotate 7<br>
&gt;<br>
&gt;                 create 644 postgres postgres<br>
&gt;<br>
&gt;                 postrotate<br>
&gt;<br>
&gt;         su - postgres -c &quot;~/pgpool/bin/pgpool reload&quot;<br>
&gt;<br>
&gt;                 endscript<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; After the first rotation, an archive is generated but the pool stops<br>
&gt; writing to the original log. Any idea what can be the reason ?<br>
<br>
</span>Because Pgpool-II does not the close log file upon receiving SIGHUP<br>
(issued by reload).<br>
<span class=""><br>
&gt; If this isnt the way can you recommend how to do rotation on pgpool`s log ?<br>
<br>
</span>Probably the easiest way to do it is setting log_destination = &#39;syslog&#39;.<br>
<br>
Another way to rotate logs is using Apache&#39;s rotatelogs program:<br>
<br>
~/pgpool -n 2&gt;&amp;1 | rotatelogs -f -n 3 &gt; /PostgreSQL/pgpool/log/pgpool.<wbr>log 10M<br>
<br>
Will create and rotate pgpool.log, pgpool.log.1, pgpool.log.2 under<br>
/PostgreSQL/pgpool/log every time current log file exceeds 10M.<br>
<br>
I think you could use logrotate if you have a program which reads the<br>
log stream from stdin and write out it to specified file. Also it<br>
needs to accept some signals (for example SIGHUP) then close and open<br>
the log file. Perhaps it is not terribly hard to create such that<br>
program. Or even there&#39;s already such a program but I don&#39;t know.<br>
<br>
Best regards,<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
</blockquote></div><br></div>