journalctl shows under systemd:
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.
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.
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 asdevice 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 onecall 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.
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 onepush 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
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.