Knowledge base

List of logs and accounting files

/logs
A list of files, not their contents

Lists the log and accounting files available on the node — what the monitor’s “Logs” page shows with download links.

The call is GET /logs?format=json (or xml).

There are no file contents here — only the list. /getFile serves the file itself by a name from this list.

Logs can be closed separately: the monitor level in http-access with the deny-logs qualifier keeps the monitor and closes the logs.

Access is decided by http-access based on the address the request came from. The key from http-api-key in the X-API-Key header grants full access from any address.

The main trap is expecting the log itself here. The endpoint answers with a list of names, and parsing designed for log lines gets a list of files. The lines come with a second request — /getFile.
What the Hub does. It does not ask: accounting reaches the Hub as a stream through the webhook, and it does not fetch engine logs over the network.
Recommended values

What to ask this endpoint:

Question This one or not
which logs and accounting files are on the node yes
what the log says no — /getFile
what happened to messages yesterday no — that is accounting
The page’s purpose, downloading a file by name and the deny-logs qualifier come from the manual (§ 5.11, § 3.3.1.58.3). The split of questions is ours.
Example configuration
# the file list, then one file by name
curl -s 'http://127.0.0.1:8080/logs?format=json'curl -s 'http://127.0.0.1:8080/getFile?file=log.txt' -o log.txt
The name for the second request is taken from the list: /getFile serves a file by name, it does not search for it.
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 whether the logs are open to the requesting address:
curl -s -o /dev/null -w "%{http_code}\n" 'http://127.0.0.1:8080/logs?format=json'
grep -n 'http-access' /etc/pmta/config
Code 403 while the monitor is open — check whether the requesting address has the deny-logs qualifier.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Untangle a stuck queue