Knowledge base

PMTA knowledge base›Block Global›Directive§ 3.3.1.59.1

log-auto-rotation

Global

Whether to switch the log file automatically at midnight
in the configuration this is a linelog-auto-rotation trueinside the block Global
Scheduled log switching

The line decides whether to switch the log file automatically at midnight. The default is true.

Together with log-rotate it sets the history depth. Switching at midnight plus eight files means a little over a week — one file per day.

It is turned off in exactly one case: when the system looks after the file. Then the two rotations stop competing, and the system’s rule remains the only one.

Size-based switching is not turned off by this line — there is none here at all: the engine log has no size ceiling, unlike accounting files.

The main trap is leaving both rotations on. The engine switches the file at midnight, the system by its own rule, and the directory ends up with files in two different naming schemes. Nothing breaks, but finding the right day becomes noticeably harder.
What the Hub does. It does not write it — so the true default applies, and the engine switches the file at midnight.

🔎 Meanwhile, next to log-file the template has a comment saying rotation is done by logrotate. Two rotations run at the same time, and this is worth bringing to one form: either turn it off here and keep the system one, or remove the system rule and rely on the built-in one.

Recommended values

Choose one rotation out of two:

Value When
true (default) the engine itself looks after the log
false system rotation looks after the file

Keeping both is a source of confusion, not of reliability.

The true default and switching at midnight come from the manual (§ 3.3.1.59.1). The note about the two rotations competing is ours.
Example configuration
# the system looks after the file — the built-in switching is turned off
log-file /var/log/pmta/log
log-auto-rotation false
With this choice, the system rule must copy and truncate or send the engine a signal: it keeps the file open.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
▲

Common mistakes and problems

what people get wrong and how it ends1 mistake▶

Keeping both rotations at once

our experience

What it costsThe engine switches the file at midnight, the system by its own rule. The directory has two naming schemes, and finding the right day turns into trial and error.
How to spot itlog.1 and log-20260828.gz lie side by side.
How to do it rightChoose one: turn off this line or remove the system rule.
Compatibility
PowerMTA 6.0
described in the manual of this version · platform: any
The vendor does not state the first version for every directive — there is no note here. The name also appears in the 5.0 edition of the manual.
Reference data
Syntax
log-auto-rotation <boolean>
Values
yes | no | true | false
Default
true § 3.3.1.59.1
Applying
reload, no restart needed
Queue
will not touch what is already queued
Where to write it
Global
How many times
once in the block
Everything here comes from the manual, with the section.
Inheritance
There is no inheritance: the line is written at the root of the file, in the Global section. It concerns the node log; accounting files have their switching configured separately, in the <acct-file> block.
How to check on the node
Switching at midnight is visible from the dates of the log files:
ls -la --time-style=long-iso /var/log/pmta/log*
Files with consecutive daily dates mean the built-in switching works. Mixed naming schemes mean system rotation is also running alongside.
In the Hub
Cost of a mistake
reversible: harms only while it is set
Scenarios
Prepare a node for sending