How to enable remote logging feature on ThingsBoard IoT Gateway

This guide will help you to enable remote logging and read logs from ThingsBoard IoT Gateway on your ThingsBoard platform instance.
For purpose of this guide, we will use following things:

  1. Locally installed instance of ThingsBoard platform (How to install you can read here).
  2. ThingsBoard IoT Gateway (How to install you can read here).

    Step 1. Remote logging activation and setting the logging level

    To activate and set logging level, please follow next steps:
  • Open the gateway device in the WEB UI.
  • Go to a tab “ATTRIBUTES”.
  • Select Shared Attributes from an Entity attribute scope list.
  • Click + button.

Remote logging - 图1

  • Fill a name field as RemoteLoggingLevel and set a value field one of the following logging levels:
  • Fill fields with the following values:

    • The name field must be RemoteLoggingLevel
    • The value field sets the logging level, the values can be as follows:
      1. DEBUG
      2. INFO
      3. WARNING
      4. ERROR
      5. CRITICAL
      6. NONE
      Remote logging - 图2
  • Click ADD

  • [Optional] Launch your gateway in case it is not running.
  • Open the LATEST TELEMETRY tab of your gateway device, and you will see the new telemetry key – LOGS.

Remote logging - 图3

Step 2. Display logs on a dashboard

It may be not convenient to review logs in the Device details window. We should show them on a dashboard.
So we will be able to investigate all logs, not only the latest one.
To do this we use following steps:

  • Check LOGS key and click SHOW IN WIDGET button:

Remote logging - 图4

  • We will use the default Cards widget:

Remote logging - 图5

  • Choose Timeseries table Card widget and add it to the Dashboard. It can be either the new one or the existing dashboard.

Remote logging - 图6

  • As a result now we can monitor the status of the gateway device from ThingsBoard environment.

Remote logging - 图7

Next steps

Explore guides related to main ThingsBoard features: