Alerts and logs¶
This section provides an overview of device alerts and logs.
Alerts and logs are currently supported by nRF91 Series devices.
nRF Cloud device alerts are messages that allow you to monitor device operations in the field.
When a device running a supported application encounters a trigger condition, it sends an alert to nRF Cloud. These conditions are, for example, when temperature is above a specified threshold, the device's battery level is below a specified value, or the device disconnects from nRF Cloud.
You can use the nRF Cloud Alerts 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.
The device can pass alert messages to nRF Cloud over MQTT or REST, depending on how you configure your application. You can then view alert notifications through the nRF Cloud portal or through the REST APIs. Alerts are visible for 30 days.
The nRF Cloud Alerts 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¶
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.
nRF Cloud logs display messages sent over supported MQTT topics or the REST
SendDeviceMessage endpoint. This can include messages related to location, operation status, device connection, FOTA jobs, and more. Logs are kept 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
* 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.
See more about the nRF Cloud Log library.
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
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.
Supported samples and applications¶
If you want to test alerts and logs, you can use the following samples and applications for the nRF9160: