Every driver running on the gateway maintains its own diagnostic log — connection events, errors, traffic dumps, and any custom messages it chooses to print. The /peers/{driver}/{id}/logs_* endpoints expose these logs over HTTP in three different formats, depending on what the consumer needs.
These endpoints are typically called by the cloud or by support tools that pull driver logs for offline analysis when debugging a remote site.
GET /peers/{driverType}/{gatewayId}/logs_file
GET /peers/{driverType}/{gatewayId}/logs_raw
GET /peers/{driverType}/{gatewayId}/logs_json
| Segment | Description |
|---|---|
driverType |
Driver name (e.g. modbus, bacnet, knx) |
gatewayId |
Numeric id of a configured gateway instance |
The three suffixes return the same log data in three different shapes. Pick the one that matches your client.
GET /peers/{driver}/{id}/logs_fileReturn the log as a downloadable .log file attachment. Suitable for browsers and clients that want to save the log to disk.
Response headers:
Content-Disposition: attachment; filename=<driverType>_<gatewayId>.log
Content-Type: application/octet-stream
Content-Length: <size>
Body:
Plain text, one log entry per line, in the gateway's standard log format.
Example — download a Modbus driver log:
curl -b cookies.txt -OJ \
'https://gateway.example.com/peers/modbus/12/logs_file'
# saves modbus_12.log to the current directory
GET /peers/{driver}/{id}/logs_rawSame content as logs_file but without the Content-Disposition header. Suitable for piping the log directly into another tool or displaying it inline in a terminal.
curl -b cookies.txt -s \
'https://gateway.example.com/peers/modbus/12/logs_raw' \
| tail -100
GET /peers/{driver}/{id}/logs_jsonReturn the log as NDJSON — one JSON object per line, parsed from the structured log entries. Suitable for log processors and observability pipelines that want structured data.
Body shape (one line per log entry):
{"ts":"2026-04-08T13:42:01.123Z","level":"info","msg":"connected to 192.168.1.50:502"}
{"ts":"2026-04-08T13:42:11.456Z","level":"warn","msg":"timeout reading register 40001"}
{"ts":"2026-04-08T13:42:15.789Z","level":"error","msg":"connection reset by peer"}
The exact field set depends on what the driver writes — ts, level, and msg are the most common, but drivers can include arbitrary fields (request ids, peer addresses, frame dumps, …).
Example — Node.js log processor:
var https = require('https')
var readline = require('readline')
var req = https.request({
host : 'gateway.example.com',
path : '/peers/modbus/12/logs_json',
headers : { 'Cookie' : 'weble.sid=...' }
}, function(res){
var rl = readline.createInterface({ input : res })
rl.on('line', function(line){
var entry = JSON.parse(line)
if(entry.level === 'error') console.error(entry)
})
})
req.end()
system.PM2subscribe method on the peers API.403.