From: Tom Lane <tgl@sss.pgh.pa.us>
To: SOzcn <selahattinozcnma@gmail.com>
Cc: Pgsql-admin <pgsql-admin@lists.postgresql.org>
Subject: Re: Log Rotation
Date: Tue, 12 Dec 2023 11:18:02 -0500
Message-ID: <2444342.1702397882@sss.pgh.pa.us> (raw)
In-Reply-To: <CAJyV5AbCRUdGE0TbdXJ02wfRGwq7uLd1UmmE-GE8nqqUf4U-Zw@mail.gmail.com>
References: <CAJyV5AbCRUdGE0TbdXJ02wfRGwq7uLd1UmmE-GE8nqqUf4U-Zw@mail.gmail.com>
SOzcn <selahattinozcnma@gmail.com> writes:
> I set the parameters as a daily. The set parameters are as follows.
> In this case, the log file is created as
> "postgresqllogtest-2023-12-12_182351.log" after the 13th day file, the logs
> in the 12th day file need to be truncated.
> Is the expected result correct? Or does PostgreSQL not support deleting,
> truncating files? I got successful results when I did this process hourly.
> However, I could not get a correct result when I tried it daily log
> truncate.
If you want log rotation, you need to choose your filename pattern
so that old log files will be overwritten after a while; or else
set up some external tool for removing the old ones. Postgres does
not do anything to keep track of old log files.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, selahattinozcnma@gmail.com, pgsql-admin@lists.postgresql.org
Subject: Re: Log Rotation
In-Reply-To: <2444342.1702397882@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox