Re: Limiting the size of log files - Mailing list pgsql-novice

From Thom Brown
Subject Re: Limiting the size of log files
Date
Msg-id AANLkTi=yTRrzPu09ZeO2Pcdff2KB=5Gd+sx1k4eAmse8@mail.gmail.com
Whole thread Raw
In response to Re: Limiting the size of log files  (Amit Soni <get.amitsoni@gmail.com>)
Responses Re: Limiting the size of log files  (Amit Soni <get.amitsoni@gmail.com>)
List pgsql-novice
On 18 August 2010 11:34, Amit Soni <get.amitsoni@gmail.com> wrote:
> Sorry for not stating this earlier. It's possible for me to have ~20GB of
> logs in one day. So, per day rotation is not the best option here. And since
> limiting the size of the file is only possible when we use some time related
> pattern in the filename (which I should have deduced from
> "log_truncate_on_rotation" not working on the size driven rotation), I see
> the chances of getting what I need as very slim.
> Any other suggestion would be greatly appreciated.
> Thanks & Regards,
> Amit
>

Just change it so that it wraps after an hour then:

log_filename to "postgresql-%M.log"
log_rotation_age to 1
log_rotation_size to 0
log_truncate_on_rotation to on

Or just go back to "postgresql.log" and use a separate log rotator to
do the task for you, like logrotate.

--
Thom Brown
Registered Linux user: #516935

pgsql-novice by date:

Previous
From: Amit Soni
Date:
Subject: Re: Limiting the size of log files
Next
From: "Jean-Yves F. Barbier"
Date:
Subject: Re: Limiting the size of log files