Skip to main content

mainlog

Last updated June 2020

The mainlog logs reception, delivery, transient failure, permanent failure, and heartbeat events. It is configured in the ec_logger.

Every event is written to the mainlog file as a single line. Fixed position codes signify whether the log line represents a reception (R), delivery (D), transient failure (T), or permanent failure (P). The log entry format differs depending upon the event type.

The following sections define the format for each event type.

Reception Records

A reception line is written to the mainlog for every reception that Momentum performs. The log entry is an @ delimited string, such as the following:

1064868656@00/00-25004-31B987F3@00/00-03736-F4101B54@00/00-04532-A3456B54@R »
@bob@example.fict@info@postalengine.com@10.0.1.1@201@esmtp@default@default

The following is a description of the fields:

OffsetExample FieldDescription
01064868656Date of reception in Unix timestamp format (seconds since 00:00:00 Jan 1, 1970)
100/00-25004-31B987F3Message's unique message-id
200/00-03736-F4101B54Batch ID
300/00-04532-A3456B54Connection ID
4RR indicating a reception
5bobLocalpart of the recipient
6example.fictDomain of the recipient
7infoLocalpart of the envelope sender
8postalengine.comDomain of the envelope sender
910.0.1.1IP address from which the message was received. For HTTP transmissions, this value will be unknown.
10201Size of the message in bytes
11esmtpProtocol over which the message was received:
esmtp – SMTP
rest – HTTP
xfer – message was transferred from another node
internal – internally generated bounce
12defaultMultiVIP® binding group to which the message was assigned
13defaultMultiVIP® binding to which the message was assigned

Delivery Records

A delivery line is written to the mainlog for every message that is delivered by Momentum, including transfers between nodes. The log entry is an @ delimited string, such as the following:

1064871280@20/00-25593-945A87F3@00/00-03736-F4101B54@00/00-04532-A3456B54@D@ »
postalengine.com@266@group-a@binding-a@0@0.393@10.0.0.1

The following is a description of the fields:

OffsetExample FieldDescription
01064871280Date of delivery in Unix timestamp format (seconds since 00:00:00 Jan 1, 1970)
120/00-25593-945A87F3Message's unique message-id
200/00-03736-F4101B54Batch ID
300/00-04532-A3456B54Connection ID
4DD indicating a successful delivery or X indicating a transfer between nodes, in a cluster configuration.
X entries appear in the delivery log on the transferring node indicating that the message left for another cluster node, while R entries appear in the reception log on the node receiving the message with xfer in its protocol field.
5postalengine.comDestination domain
6266Size in bytes of the delivered message
7group-aMultiVIP® binding group to which the message was assigned
8binding-aMultiVIP® binding to which the message was assigned
90Number of times the message has been retried. A value of 0 indicates the initial attempt.
100.393Amount of time, in seconds, between reception and delivery
1110.0.0.1IP address that accepted the message

Transient Failure Records

A transient failure line is written to the mainlog for every transient failure that occurs. A transient failure is a failure that allows Momentum to retry sending the message. The log entry is an @ delimited string, such as the following:

1064869327@00/00-25593-CBD987F3@00/00-03736-F4101B54@00/00-04532-A3456B54@T@ »
example.fict@0@group-a@binding-a@15@0@18.53@10.0.0.1@421 no adequate servers

The following is a description of the fields:

OffsetExample FieldDescription
01064869327Date of transient failure in Unix timestamp format (seconds since 00:00:00 Jan 1, 1970)
100/00-25004-31B987F3Message's unique message-id
200/00-03736-F4101B54Batch ID
300/00-04532-A3456B54Connection ID
4TT indicating a transient failure
5example.fictDestination domain
60Number of bytes of data transferred before the failure occurred. A value of 0 indicates no connection could be made.
7group-aMultiVIP® binding group to which the message was assigned
8binding-aMultiVIP® binding to which the message was assigned
915Stage of the message (See “Connection Stages”.)
100Number of times the message has been retried. A value of 0 indicates the initial attempt.
1118.53Amount of time, in seconds, between reception and this transient failure
1210.0.0.1IP address of the server that rejected the message
13421 no adequate serversError message associated with the failure

Permanent Failure Records

A permanent failure line is written to the mainlog for every permanent failure that occurs. A permanent failure indicates that the attempted message failed in such a way that it should not be retried again. After logging a permanent failure, the message will be discarded. The log entry is an @ delimited string, such as the following:

1064870847@10/00-25593-393A87F3@00/00-03736-F4101B54@00/00-04532-A3456B54@P@ »
postalengine.com@31@group-a@binding-a@5@1@3.89@10.0.0.1@552 No such account

The following is a description of the fields:

OffsetExample FieldDescription
01064870847Date of permanent failure in Unix timestamp format (seconds since 00:00:00 Jan 1, 1970)
110/00-25593-393A87F3Message's unique message-id
200/00-03736-F4101B54Batch ID
300/00-04532-A3456B54Connection ID
4PP indicating a permanent failure, such as an in-band bounce
5postalengine.comDestination domain
631Number of bytes of data transferred before the failure occurred. In this example, 31 bytes were transferred before the remote server returned its error.
7group-aMultiVIP® binding group to which the message was assigned
8binding-aMultiVIP® binding to which the message was assigned
95Stage of the message (See “Connection Stages”.)
101Number of times the message has been retried
113.89Amount of time, in seconds, between reception and the time of permanent failure
1210.0.0.1IP address of the server that rejected the message
13552 No such accountError message returned from the remote host

Heartbeat Records

In addition to the records described in the previous sections, a heartbeat is written periodically to the log, indicating that Momentum is still active and may log further data. The log entry is an @ delimited string, such as the following:

1251470342@@@@M

The following is a description of the fields:

OffsetExample FieldDescription
01251470342Date of delivery in Unix timestamp format (seconds since 00:00:00 Jan 1, 1970)
1 Unused
2 Unused
3 Unused
4MM indicating a heartbeat

Having three unused fields ensures that, like other logs, the fifth field is the log entry type. This makes parsing easier.

Was this page helpful?