Skip to main content
pgw writes one line for each event. Every line about a device or a call carries the same identifying fields, so one search returns every line about that device or call. pgw writes to standard output, which journalctl shows under systemd:
Set log_level to debug, info, warn, or error. The default is info. By default, each line is a list of key=value fields. pgw quotes a value that holds a space, a quote, or a line break, so an event never takes two lines.
pgw never logs push tokens, pn-* parameters, or credentials.

Filter by level

journalctl shows errors in red and warnings in yellow. To list only warnings and errors, filter by priority.
Under systemd, pgw starts each line with a syslog priority, which journalctl uses to color and filter. This needs the systemd default, SyslogLevelPrefix=yes, in the pgw service. With SyslogLevelPrefix=no, each line in the journal starts with <3>, <4>, <6>, or <7> instead. In a terminal on Linux or macOS, pgw colors errors red, warnings yellow, and debug lines dim. To change how lines show their level, set log_color, which Settings describes.

Fields that name a device

Lines about a device or a call carry the following fields. A line leaves out a field that pgw doesn’t know, such as device when the app sends no User-Agent. To follow one device, search for its AOR.

Registration lines

changes holds one or more of the following values, separated by commas, such as changes=contact,remote_addr.

Call lines

pgw writes one call ended line for each device that a call rings, when that device’s part of the call ends. A call to a user with three devices writes three lines with the same call_id.
The line also has the following fields. An INVITE that pgw refuses with 403 or 404 before it rings a device writes no call ended line. pgw logs invite refused with the reason instead, at most once a minute for each source address.

Push lines

pgw writes one push line for each push that it sends or skips. The line has the fields that name the device, plus call_id, type, status, push_type, and err. type is call, missed, refresh, or test, and status is the push service’s HTTP status. A failed push writes a WARN line. A skipped push, a push that pgw held back, and a call push whose call ended while the push waited in the queue each write an INFO line.

Messages to watch for

The following line reports an unreachable PBX.

Send logs to a log collector

1

Turn on JSON logs

Set log_format: json in the configuration file, or set PGW_LOG_FORMAT=json.
2

Restart pgw

Each line is now one JSON object with the same fields.
If you also turn on the SIP message log, set sip_log_format: json, so the collector gets SIP messages as JSON lines.

Next steps

Log SIP messages

See every SIP message of one call or registration.

Read the push log

Check what the push service answered for each push.