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":1775655721123,"level":"info","message":"connected to 192.168.1.50:502"}
{"ts":1775655731456,"level":"warn","message":"timeout reading register 40001"}
{"ts":1775655735789,"level":"error","message":"connection reset by peer"}
ts: Unix time in milliseconds.level: log, info, warn or error.message: the text of the entry (it can span several lines).The fields are always these three. Lines are separated by \n.
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' : 'WBLSUPSID=...' }
}, 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()
/var/log/weble/<driver>_<id>.log), merged and sorted by time, at most the last 4000 entries. A driver restart does not clear the file history.none (default) keeps nothing, so these endpoints return an empty body; choose ram or file to keep a history. The level setting (error, warn, info, log) controls how much the driver writes.200 with an empty body.gateways.getDriverLogs (also available on loggers and logics) through the dispatcher, with a capture window in milliseconds:curl -b cookies.txt -X POST -H 'Content-Type: application/json' \
-d '{"args":[12,{"lines":300,"durationMs":10000}]}' \
'https://gateway.example.com/peers/supervision/gateways/getDriverLogs'
401, and calls from a role that may not read driver logs return 403.