Re: How to maintain the csv log files in pg_log directory only for past 30 days

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Raghavendra Rao J S V <raghavendrajsv(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: How to maintain the csv log files in pg_log directory only for past 30 days
Date: 2018-09-28 13:19:16
Message-ID: 93d6c6ec-141e-70a4-7b15-7c4b1ba4f146@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/27/18 10:25 PM, Michael Paquier wrote:
> On Fri, Sep 28, 2018 at 10:33:30AM +0530, Raghavendra Rao J S V wrote:
>> Log file will be generated in *csv* format at *pg_log* directory in our
>> PostgreSQL. Every day we are getting one log file. We would like to
>> maintain only max 30 days. Which setting need to modify by us in
>> “postgresql.conf” in order to recycle the log files after 30 days.
>
> If you use for example log_filename = 'postgresql-%d.log', then the
> server uses one new file every day. This truncates the contents from
> the last month automatically.

If log_truncate_on_rotation = 'on', correct?

> --
> Michael
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Arup Rakshit 2018-09-28 13:19:31 Re: Why my query not using index to sort?
Previous Message Ravi Krishna 2018-09-28 13:08:54 Re: Why my query not using index to sort?