Skip to content

Alerts and logs

This section provides an overview of device alerts and logs.

Device requirements

Alerts and logs are currently supported by nRF91 Series devices.

Device alerts

nRF Cloud device alerts are messages that allow you to monitor device operations in the field.

When a device running an application encounters a trigger condition, it sends an alert to nRF Cloud. An alert is sent, for example, when the temperature exceeds a specified threshold value or the device's battery level is below a specified value.

You can use the nRF Cloud Alert library to configure predefined conditions or create new ones. Alert conditions are defined in the device's application code. See the library documentation for a full list of features and dependencies.

You can view alert notifications through the nRF Cloud portal or the REST APIs. Alerts are stored for 30 days.

Alert types

The nRF Cloud Alert library documentation includes a full list of alert types. You are not limited to these predefined alert types. See Usage for more information on how to create custom alert definitions.

Access and security

All team members can see alerts and messages for devices in a team, regardless of the user's role and group access, when calling the ListMessages or ListDeviceAlerts endpoints.

In the nRF Cloud portal, messages are shown only on an individual device's page, but alerts are visible on the Alerts page for all devices associated with the team.

If you want to keep alerts and messages secret for one or more devices, create a separate team for those devices.

Device logs

nRF Cloud enables you to configure logging level at runtime. You can collect and display log messages sent over supported MQTT topics or the SendDeviceMessage REST endpoint. See the integrated nRF Connect SDK libraries for device side support for logs. Logs are stored for 30 days.

Logs are available in JSON and binary formats at the following levels, in increasing order of detail:

Value in nRF Cloud portal for changing log level Value in nRF Cloud portal log message Value in downloaded CSV file Value in APIs
Disable 0-dis * "<dis>" 0
Error 1-err "<err>" 1
Warning 2-wrn "<wrn>" 2
Info 3-inf "<inf>" 3
Debug 4-dbg "<dbg>" 4

* The device never sends a log message with a log level of 0 if using the nRF Cloud Log library. Setting the log level to 0 disables all logging. If a log message with a log level of 0 is received by nRF Cloud, its value is as shown in the table.

Levels are defined according to Zephyr logging.

You can view device logs in the nRF Cloud portal or through the APIs.

See more about the nRF Cloud Log library.

Binary logs

nRF Cloud also supports dictionary-based (binary) logging. These log messages are potentially much smaller than JSON-based log messages, but they are not human-readable in their basic form. The ID for binary logs is DICTLOG.

Binary logs require a log_dictionary.json file. The contents of this file can change if you make changes to the device's application firmware. See Configuration for more information.

If you enable your device to use binary logs, you can download these logs through the nRF Cloud portal. You must then use a parser to convert the log content to a human-readable form.

See Dictionary-based logging for more information on how to enable and use binary logs in your own application.

For more information on how binary logs specifically work with nRF Cloud and supported samples, see Supported backends and Configuration in the nRF Connect SDK documentation.

Once your device is ready to use binary logs, you can retrieve them through the nRF Cloud portal or APIs.

Supported samples and applications

If you want to test alerts and logs, you can use the following samples for the nRF9160 and nRF9161:

See next