Skip to content

Logs ​

This page shows you how to follow device messages, rule activity and agent calls as they happen, and where to look when you need the history of one device or one rule.

The Logs page is under Developer › Logs in the sidebar (/logs).

The Logs page with the "Live tail" status, the filter box, the level and source filters, and log lines from devices, rules and an agent

Read the page ​

When the page opens it loads the newest 200 stored lines. After that, every new line appears at the top while Live tail is shown next to the title.

Each line has four parts: the time, the level, the source and the message.

LevelMeaning
InfoNormal activity
WarningSomething to look at: a device went offline, a battery is low
ErrorSomething failed: a payload could not be decoded, a notification was not sent, a rule run failed
AgentA call an AI agent made

What is logged ​

SourceLines
ingestEach accepted message from a device ("uplink accepted <device> · 4 datapoints"), payloads that could not be decoded, and payloads an integration rejected
devicesA device came online or went offline, a device was added or changed, a board introduced itself, a battery is low, and changes to templates
rulesWhat the log steps of your rules wrote, notifications sent, held for quiet hours or not sent, rule runs that failed, and approvals of agent changes
agentEvery MCP tool call an agent made, with its arguments, the size of the answer and who made it. Values named like a secret, password, token or key are hidden. See Agent tools

Lines that fit none of these sources, such as firmware rollouts, also show under ingest.

Two things are different from what you may expect:

  • "uplink accepted" lines exist only in the live tail. They are not stored, so they are gone when you reload the page. The readings themselves are stored. Query them in the Data explorer.
  • A rule run that finishes without a log step, a notification or an error writes no line. Each run is recorded in the rule_executions table instead.

Pause, filter and export ​

  • Pause stops new lines from moving the list. The status shows how many lines arrived in the meantime. Resume adds them.
  • The Filter by device, rule or text box searches the message and the source of each line.
  • All, Info, Warning, Error and Agent filter by level. The number next to a level is the count of loaded lines.
  • Source filters by source.
  • Export downloads the lines that match your filters as a text file named sensora-logs-<date>.txt. Each line has the time, level, source and message, separated by tabs.

The level and the source filter are kept in the address of the page, for example /logs?level=error&scope=rules, so you can bookmark a filtered view.

The page shows at most the newest 500 matching lines. An export contains all matching lines the page has loaded: the 200 stored lines from when it opened, plus up to 1,000 lines that arrived since.

If the status reads Not connected, the stored lines still show. New lines appear again when the server answers.

Limits of the page ​

  • A line shows the time of day in the server's time zone, without a date. Stored lines show hours and minutes. Live lines also show seconds.
  • The message of a status line ("device came online") does not name the device. To follow one device, use its own log, described below.
  • The page cannot load lines older than the newest 200. For older lines, or for dates, query the events table:
sql
SELECT at, device_uid, type, detail
FROM events
WHERE at > now() - interval '7 days'
  AND type LIKE 'rule.%'
ORDER BY at DESC

The log of one device ​

  1. Open Devices and select a device.
  2. Select the Logs tab.

The tab lists the newest 100 stored lines for that device: status changes, decode errors, low battery and rule notifications. It refreshes every 20 seconds.

The same lines are available over the API. limit can be up to 200.

bash
curl "http://localhost:8090/api/events?scope=<device_uid>&limit=50"

The log of one rule ​

  1. Open Developer › Rules and select a rule.
  2. Select Logs above the canvas.

The dialog lists what this rule wrote, newest first: its log steps, notifications it sent or could not send, notifications held for quiet hours, and runs that failed. It refreshes every 10 seconds while it is open.

To see every run of a rule, including runs that wrote no line, see Rule editor.

How long lines are kept ​

Stored lines are kept forever by default. To delete old lines automatically, do one of these:

  • In Settings › Server & storage, set Events to 7 days, 30 days or 90 days.
  • Set RETENTION_EVENTS in the server's environment, for example RETENTION_EVENTS=30d.

A value saved in Settings overrides the environment variable. Rule runs in rule_executions are kept for 30 days by default (RETENTION_RULE_EXECUTIONS). See Operations and Configuration.

Sensora is open source under the Apache 2.0 license.