The manual sets the priority unambiguously: the engine writes its own error messages here, not to the system log. The system log remains a fallback — for the case when the engine cannot write to its own file at all.
The contents are broad by design. One file holds lifecycle events — startup and shutdown — runtime errors, connection and command traces, which are enabled by logging directives for each source or receiver, and resolver warnings.
Rotation is automatic, and its parameters are part of the configuration: how many past files to keep is decided by directives. That is, the history depth is a setting, not a property of the file.
Do not confuse it with accounting. Accounting is data about messages, one record per recipient, and it exists for reports. The log is about the engine itself, and it exists for investigations. Their directives differ, their purposes differ, and one cannot stand in for the other (log-accounting-separation).
This is a deliberate division: accounting answers questions about messages, the log about the engine itself. But it has a cost: a failure that happened before a message got into accounting is invisible to the Hub. For example, configuration parsing during a settings reload — it gets into the log, while nothing gets into accounting.
So when investigating unclear node behavior, the log has to be viewed by hand by logging into the machine — and it is worth remembering that it is there and holds more than telemetry does.
What to look for in the log and when:
| Event | When to look |
|---|---|
| startup and shutdown | the node did not come up or restarted by itself |
| configuration parse error | a settings reload failed |
| resolver warnings | delivery is not going to some of the domains |
| connection and command traces | investigating a specific receiver — enable selectively |
History depth is a setting. The number of kept files is set by logging directives; the default is reasonable for a quiet node and too small for one with detailed traces enabled.
An investigation starts here, not with the system log. Only what the engine could not write to its own file gets into the system log.
# an investigation starts with two questions to the log tail -n 200 /var/log/pmta/loggrep -i 'error\|warn' /var/log/pmta/log | tail -50
what people get wrong and how it ends3 mistakes▶
§ 4.1.2
§ 4.1.2
§ 4
3 relations
The log and accounting — two files and two different questionsThe log is about the engine, accounting is about messages: different directives and different purposes. § 4.1.2Where the node writes why it did not startA separate file for startup failures — for the case when there is no one left to write to the main log. § 4.2.1
The node needs a resolver that does all the work itselfRepeated referrals from one server produce a log warning — the only sign of this malfunction. § 4.2.3LogsThe file this output refers to. § 5.11Return a node fileThe file this output refers to. § 5.11Start a new log fileCloses the current file and starts a new one. § 6.3.10Delivery attempt with the session loggedThe file the command works with. § 6.3.23
ls -lh /var/log/pmta/ tail -n 100 /var/log/pmta/log grep -c -i 'error' /var/log/pmta/log
3 articles
◇What the node tells about itself and through which channelsSeven observation surfaces: the web monitor, the console in four formats, the log, accounting, accounting search, metrics and export to external analytics.◇The log and accounting — two files and two different questionsThe engine keeps a separate log and a separate accounting file; the separation is made for the sake of format, performance and the ability to hand over the log without disclosing data.◇A file, a program or an endpoint — and a file under each of the threeThree ways to hand off accounting records; an endpoint still has a file underneath, which is deleted only after a successful send, and a non-2xx response triggers a retry.