Re: BUG #19025: PostgreSQL log is not rotated

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: jose(dot)morcillo(dot)valenciano(at)gmail(dot)com, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #19025: PostgreSQL log is not rotated
Date: 2025-08-19 13:41:59
Message-ID: 34ba519e-74e6-44a9-bd87-30e4bffbff4e@app.fastmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Tue, Aug 19, 2025, at 7:21 AM, PG Bug reporting form wrote:
> We have configured our log rotating policy as follows:
>
> logging_collector = on
> log_destination = 'stderr'
> log_directory = '/postgresql/16/log/cpdm-cluster86'
> log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log'
> log_rotation_age = 1d
> log_rotation_size = 250MB
> log_truncate_on_rotation = on
>
> But the log is 16GB and no rotation has happened:
>
> [PRO] $ ls -lh
> total 16G
> -rw-r--r-- 1 postgres postgres 16G Aug 19 12:16
> postgresql-2025-07-12_001207.log
>

Did the log say something? I'm wondering if the log_directory has the right
permission.

Are you sure that you reload and/or restart the service after changing these
parameters? Most of them require a reload but logging_collector requires a
restart.

You enable log_truncate_on_rotation but there won't be another log file with
the same name. Hence, no truncate will occur. The truncation only occurs due to
time-based rotation.

You are using an outdated version (16.2). The current minor version is 16.10.
You are ignoring 1.5 year of fixes. A minor version doesn't add new features;
it only adds bug fixes and security fixes.

--
Euler Taveira
EDB https://www.enterprisedb.com/

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-08-19 14:33:28 Re: BUG #19024: Error when trying to use pg_dump of new server on old server
Previous Message Kirill Reshke 2025-08-19 13:04:51 Re: BUG #19024: Error when trying to use pg_dump of new server on old server