Hub Logging


hub.log.send

Send logs to cloud

Field Type Required Description
select JsonArray - List of log filenames to be send

return result fields:

Return empty result or error

Examples

call

{
    "id": "_ID_",
    "method": "hub.log.send",
    "params": {}
}

reply

{
    "error": null,
    "id": "_ID_",
    "method": "hub.log.send",
    "result": {}
}

Send specific logs

{
    "id": "_ID_",
    "method": "hub.log.send",
    "params": {
        "select" : ["ha-networkd.log", "ha-uid.log"]
    }
}

reply

{
    "error": null,
    "id": "_ID_",
    "method": "hub.log.send",
    "result": {}
}

errors:

Code Message
-32500 Send logs error

hub.log.local.set

Change a logging level on the controller. Newly set values will be applied immediately in the current and all future sessions.

The level has been set hides all records with a lower logging level. Use ERROR to show only errors; INFO to show errors, warnings and info records; TRACE to show everything.

Field Required Type Description
params.severity + enum Log severity level to write, one of: ERROR, WARNING, INFO, DEBUG, TRACE
params.color - bool If true - enables to write coloured logs
params.indent - int One of -1, 2, 4, 8. Sets the indentation value for JSON objects pretty-printing. -1: print minified JSON, 8 - print JSON indented with 8 bytes offset.
Broadcasts Description
hub.setting.updated Up to three hub settings could be updated by the command: logs.level, logs.color, logs.indent

errors:

Code Message Data
-32602 The severity with this name does not exist ezlo.severity.not.exist
-32600 Wrong params, (FIELD) rpc.params.invalid.{FIELD}

Examples

call

Set logging level to INFO, all other options will not be modified:

{
    "id": "_ID_",
    "method": "hub.log.local.set",
    "params": {
        "severity": "INFO"
    }
}

reply

{
    "error": null,
    "id": "_ID_",
    "result": {}
}

call

Set logging level to DEBUG, turn logs colouring on, indent JSON objects using 8 spaces for maximum JSON objects pretty-printing.

{
    "id": "_ID_",
    "method": "hub.log.local.set",
    "params": {
        "severity": "DEBUG",
        "color": true,
        "indent": 8
    }
}

For every changed hub setting the hub.setting.updated broadcast will occur.