The engine keeps two streams of records, and confusing them is the most common mistake when investigating a malfunction.
The log answers the question “what did the node do”: startup and shutdown, errors, connection traces when the switches are enabled. It is the first place to look when something went wrong.
Accounting answers the question “what happened to the messages”: one record per event, in a machine-readable format. It is configured with the <acct-file> block.
The separation is made for three reasons, and the vendor names them directly. The accounting format is more efficient for subsequent processing. Performance — accounting is written by its own rules. And the third, the most practical: the log can be handed over to support without disclosing accounting data.
The engine writes to the operating system log only what it could not write to its own — startup errors and the like. An empty engine log on a non-working node means that is where to look.
Both have rotation, but it is configured separately: log-rotate and log-auto-rotation for the log, move-interval, max-size and delete-after for accounting.
Accounting is the source of all analytics: it arrives via webhook, is parsed, goes into the database and feeds the fleet panels.
The log we do not collect at all. It is read during investigations — over SSH, by hand. This is a deliberate choice: the log is voluminous, and the questions the panels ask are answered by accounting.
🔎 This leads to a practical rule for us: if a panel shows emptiness while the node is working, look at the log, and on the node itself. Telemetry about messages will say nothing about why it is not arriving.
The mechanism has no values of its own — they are set by two groups of lines:
| What | Log | Accounting |
|---|---|---|
| where it lives | log-file | the path in the <acct-file> tag |
| how long it is kept | log-rotate | delete-after |
| when it switches | log-auto-rotation | move-interval, max-size |
| level of detail | log-* switches | records, record-fields |
# two streams, two settings, two different questions log-file /var/log/pmta/loglog-rotate 8 <acct-file /var/log/pmta/acct.csv> records d, b delete-after 7d </acct-file>
what people get wrong and how it ends3 mistakes▶
§ 4.1.2
§ 4.1.2
our experience
2 relations
ls -la /var/log/pmta/
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.◇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.◇The watchdog that restarts the engineKeeps an eye on the engine and brings it back up after a crash by itself, sending a crash report to the postmaster address.