Knowledge base

PMTA knowledge base›Block Global›Directive§ 3.3.1.58.22

http-log-requests

Globalrestart required

Whether to log requests to the web monitor
in the configuration this is a linehttp-log-requests falseinside the block Global
Who asked the monitor what

With true, the monitor logs calls made to it. Off by default, which means that by default calls to the management interface leave no trace.

The monitor has its own log — /var/log/pmta/pmtahttp.log, separate from the engine log. Denials under http-access go there too, and they are written regardless of this line.

This is the only way to find out what was done through the API. Commands sent over HTTP and configuration edits through the interface leave no other trace: the engine log does not show them. Where the key has been given to several applications, the question “who stopped the queue” cannot be answered without this line.

The manual’s wording for this line and for http-log-data coincides word for word — “whether web monitor data exchanges are logged”. Judging by the fact that the second is described as “more verbose”, this one logs the requests themselves, and that one their content as well.

The main trap is discovering the absence of records after the fact. The question “who did this” comes up after an incident, and by then it is too late to enable logging: the past will not be restored. The line costs less than it seems, and it makes sense to enable it in advance.
What the Hub does. It does not write it — the call log stays off. Keep in mind: the Hub polls once a minute, and the “Monitor” screen with auto-refresh adds five requests per refresh — the log will grow noticeably, but a trace of actions sent with the key will appear.
Recommended values

The decision depends on how many people have the key:

Value When
false (default) only the Hub talks to the monitor
true the key is given to people or to several applications

The volume is determined by polling frequency, not by the number of messages: this is a management log, not a delivery log.

The default false is from the manual (§ 3.3.1.58.22). The name of the monitor log is from § 3.3.1.58.3, its directory is set by the log-file line (§ 3.3.1.59.2). That it is the only trace of API actions, and the advice to enable it in advance, are ours.
Example configuration
# a trace of actions sent with the key: enable before an incident, not after
http-mgmt-port 1000
http-log-requests true
The line answers the question “who did this”. Set after an incident, it will no longer answer it.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
▲

Common mistakes and problems

what people get wrong and how it ends2 mistakes▶

Looking for API calls in the engine log

our experience

What it costsThe monitor has a separate log. These lines will never appear in /var/log/pmta/log, however much you enable.
How to spot itThe line is enabled, but nothing has changed in the usual log.
How to do it rightLook at /var/log/pmta/pmtahttp.log.

Enabling logging after an incident

our experience

What it costsPast calls cannot be restored. There will be no answer to the question “who did this” at all.
How to spot itThe log begins at the moment the investigation started.
How to do it rightEnable it in advance — where people, not only a program, have the key.
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.
Reference data
Syntax
http-log-requests <boolean>
Values
yes | no | true | false
Default
false § 3.3.1.58.22
Applying
a service restart is required
Queue
will not touch what is already queued
Where to write it
Global
How many times
once in the block
Everything here comes from the manual, with the section.
Inheritance
No inheritance: the line is written at the root of the file, the Global section, and applies to the whole management interface. Logging cannot be enabled selectively — by address or by key.
How to check on the node
We open the monitor log and make one request:
tail -f /var/log/pmta/pmtahttp.log
With logging on, a call line will appear. Empty — either the line has not taken effect (the monitor needs a restart), or you are looking at the wrong file: the monitor log is separate from the engine log.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Node security