Knowledge base

rotate log

Start a new log file
Manual rotation, when there is no point waiting for the schedule

Immediately rotates the log file; this does not cancel the midnight rotation.

Useful before diagnosis: the fresh file contains only what happened after the command.

The main trap is looking for old entries in the new file. Everything from before the rotation stayed in the previous one: the fresh log is not empty because nothing happened.
What the Hub does. It calls it — the “Rotate logs” operation goes through POST /command with the node key. During installation the Hub also places a logrotate rule for /var/log/pmta/log on the node, if the package did not bring its own.
Recommended values

When to use it:

Question This command or not
start a clean log before diagnosis yes
rotate accounting files no — rotate acct
The action and keeping the midnight rotation come from the manual (§ 6.3.10). The trap analysis is ours.
Example configuration
# start a new log before reproducing the error
pmta rotate log
The reply is “Logging file rotated.”.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
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.
How to check on the node
Check that the log has been started anew:
ls -lt /var/log/pmta/ | head
The current log file should be fresh and small; the previous one sits next to it.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Untangle a stuck queue