---
title: Alerts and debugging
project: IoT Platform
version: 1.0
section: development
language: en
license: Total.js Enterprise
url: https://totaljs.es/docs/iot/1-0/development/alerts-and-debugging/
updated: 2026-11-20T06:56:13.114Z
---

# Alerts and debugging

> Report problems of a device as alerts and write debug messages to the log of the stream.

## Report an alert

`instance.throw(message)` creates an alert for the device. It appears on the **Alerts** screen with the name of the device:

```js
if (data.battery < 10)
	instance.throw('Battery low: ' + data.battery + ' %');
```

![An alert about a low battery](/files/JaszP81s061f.webp)

Report what the people who look after the devices must act on. See [Alerts](../../guides/alerts/).

## Write debug messages

`instance.debug()` writes a line to `logs/debugger.log` in the folder of the stream. It takes up to four values:

```js
instance.debug('Interval changed to', $.data.minutes, 'minutes');
```

The stream writes the collected lines once a minute. Each line has the time in UTC, the name of the driver and the id of the device:

```text
2026-11-20 05:49:44 Demo weather station (JasoWV1cL61f) Interval changed to 15 minutes
```

## Check what the stream runs

The [status page of the stream](../../guides/stream/) lists every device and extension with its counters. When a device is missing, the stream has not loaded it yet or the device is disabled.

## Test with real data

Replay recorded readings with [Simulations](../../guides/simulations/), or post them with `curl` as in [Your first driver](../first-driver/).
