Returns a log or accounting file by name — the one the “Logs” page offers for download.
The call is GET /getFile?file=log.txt, where log.txt is a file name from the /logs list. There is no format parameter: the file itself arrives.
A way to read the log without logging into the machine. ⚠️ And at the same time a way to read it for anyone who has reached the monitor port: logs and accounting hold recipient addresses and receiver replies.
To cut off files while keeping the monitor, use the deny-logs qualifier on the monitor level in http-access.
The key from http-api-key in the X-API-Key header grants full access from any address.
What to ask this endpoint:
| Question | This one or not |
|---|---|
| log lines without logging into the machine | yes |
| messages from previous days | yes — through the accounting file, until it is deleted |
| which files exist | no — /logs |
# download a log file by name from the list curl -s 'http://127.0.0.1:8080/getFile?file=log.txt' -o log.txt
4 relations
List of logs and accounting filesA neighboring catalog entry. § 5.11
curl -s -o /dev/null -w "%{http_code}\n" 'http://127.0.0.1:8080/getFile?file=log.txt'
grep -n 'http-access' /etc/pmta/config
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.