A logger stores the history of address values in a database, so that you can read it later in charts, exports and through the API. The Weble IoT Universal Gateway can run several loggers at the same time: a local MySQL (MariaDB) database on the device, an external MySQL server, the Weble cloud, or a central log server that collects the history of other devices.
This page describes the Loggers menu. Choosing what is recorded for each address is explained in Log and Store value policies, and rewriting existing history in Correcting logged data.
never, always, every 15 minutes, on change, on a cron schedule… See Log and Store value policies.default subscription, a buffer that delivers them to every running logger.Nothing is recorded as long as Log is
never(the default) on an address, or as long as no logger is running. Recording starts when both are set: there is no catch-up of earlier values.
Log is not the same as Store value: Store value only keeps the last value of an address across a restart of the device, it does not build any history. Both are explained in Log and Store value policies.
The Loggers menu of the administration is shown to administrators only. A warning sign with a number next to the menu title counts the crash logs of the loggers.
The menu contains:
| Entry | Use |
|---|---|
| Insert logger | Creates a new logger (see 2.1). |
| Search a logger | Filters the list of loggers by name or driver. Below the field, the list of loggers with their state. |
| Subscriptions | Advanced screen of the acquisition pipeline (see 7). |
| Connectors | Data sources of the dashboards (local device, remote device, log server). See Dashboards and charts. |
| Dashboards | Chart and dashboard editor. See Dashboards and charts. |
mysql, cloud or logServer (see sections 3 to 5).| Button | Action |
|---|---|
| ▶ Start / ⟳ Restart | Starts a stopped logger, or restarts a running one. A started logger starts again automatically after a restart of the device. |
| ■ Stop | Stops the logger. It stays stopped after a restart of the device. |
| ⚙ Edit | Opens the fields of the logger for editing. Confirm with the check mark, or cancel with the cross. |
| 🗑 Remove | Deletes the logger after confirmation. |
The state of the logger is shown by the colour of its line, as for gateways (connected, connecting, disconnected). Click the name of a logger to open its panel with the tabs Status, Data and, for MySQL loggers, Correction.
To pause recording, stop the logger rather than removing it.
The mysql logger writes the history into a MySQL / MariaDB database: a database server run by the device itself, or an external server.
| Field | Default | Description |
|---|---|---|
| Name | — | Name of the logger (required). |
| Storage | remote |
fs: database server run by the device, data on its internal storage. usb: database server run by the device, data on a USB disk. remote: an external MySQL / MariaDB server. On Windows, only remote is offered: no database server is installed with the software. |
| Database | weble |
Name of the database. |
| Host | 192.168.1.99 |
Shown with remote. Address of the external server. |
| Port | 3306 |
Shown with remote. TCP port of the external server. |
| Username, Password | — | Shown with remote. Account on the external server. |
| USB | — | Shown with usb. The USB disk to use. On Linux, when the disk holds no database yet, the device creates one. |
| Service only | off | Shown with fs and usb. Only starts the database server of the device: this logger then records nothing itself. ConnectionLimit and Custom data dir appear only when this box is ticked. |
| ConnectionLimit | 12 |
Maximum number of simultaneous connections to the database. |
| Custom data dir | — | Folder that holds the database files, instead of the default folder. |
| Subscriptions | default |
Keep the default value. |
New MySQL loggers store their time stamps in UTC, which avoids duplicate or missing hours at the summer and winter time changes. Loggers created with older software versions keep storing local time.
Prefer
usborremotefor large histories: a database on the internal SD card of the device wears it out over time. See 8.2.
The cloud logger sends the history to the Weble time series cloud.
| Field | Default | Description |
|---|---|---|
| Name | — | Name of the logger (required). |
| Servers | default cloud servers |
default cloud servers: the Weble servers. define custom server(s): your own log servers, listed in Custom server(s). |
| Custom server(s) | — | Shown with define custom server(s). For each server: Host, Port, Type (tls or tcp) and, for tls, the Certificate of the server. |
| Subscriptions | default |
Keep the default value. |
The logServer logger turns the device into a central server that receives the history sent by the cloud loggers of other devices (with define custom server(s)). It is available on Linux only.
| Field | Default | Description |
|---|---|---|
| TLS server enable | — | Accepts encrypted connections. Sub-fields: Interface, Port (10103), rejectUnauthorized, Private key, Certificate. |
| TCP server enable | — | Accepts unencrypted connections. Sub-fields: Interface, Port (10101). |
| Black list enable | — | black list or white list of client devices, set in Elements. |
| HTTP API enable | — | HTTP API to read the collected history. Sub-fields: Interface, Port (10104), Authorized API keys. |
Good practice: prefer the TLS server, choose in Interface the network interface that the client devices actually use, and restrict the clients with a white list.
The Status tab shows the databases of the logger with the size of their tables, the number of values written by the logger (in total and per second) and the usage of the database server.
The Data tab reads the history stored by this logger:
The Data tab has no chart: charts are built in Loggers › Dashboards, see Dashboards and charts.
Only on MySQL loggers. It modifies, deletes or imports logged values and recomputes the aggregates. See Correcting logged data.
Loggers › Subscriptions shows the acquisition pipeline: which addresses are captured, when, and how they are delivered to the loggers and other subscribers. The view Logged addresses lists the addresses that are recorded; the view Subscriptions lists the subscriptions, and New subscription creates one, with the presets Realtime, Batch, High volume and SD friendly.
The default subscription feeds every logger with the addresses whose Log is set. Change it only if you know why: a wrong setting on default stops the recording of history. The fields are described in Subscriptions.
A MySQL logger keeps the raw values in the table logs and precomputes aggregates (average, minimum, maximum, first, last value and number of values) in the tables logs_minutely (1 minute), logs_quarterly (15 minutes), logs_3hourly (3 hours), logs_daily, logs_weekly and logs_monthly. A query on a long period reads these tables, which makes long charts fast; a query with an interval that has no table of its own (20 minutes, for example) is computed from the closest ones.
The average is weighted by time: a value counts until the next one is recorded, without linear interpolation.
The tables are split into monthly partitions. When a table holds more than 100 partitions, the oldest months are deleted from all tables, with the same cut-off date. A MySQL logger therefore keeps about 8 years of history.
Every recorded value is a write on the storage. On an SD card, record only what you need: use on_change with a threshold or an interval rather than always on values that change quickly, and prefer a USB disk or an external server for large installations. See Log and Store value policies.
Daily, weekly and monthly aggregates are cut in the time zone of the device. Through the API, a query can ask for another time zone and for a shifted day, for example a gas day from 06:00 to 06:00 (aggregate: "1d+6h"). See Peers API: loggers.
| Symptom | Check |
|---|---|
| An address has no history | Its Log is never, or no logger was running at that time. |
| The logger does not turn green | MySQL remote: host, port, account and network. usb: the USB disk is plugged in and selected in USB. Open the crash log from the warning sign of the menu. |
| Values arrive late | The logger was disconnected and is emptying its buffer. |
| A value is recorded too often | Its Log is always on a value that changes often: use on_change with a threshold, a throttle or an interval. |
See also Logs and diagnostics and Troubleshooting › History or dashboards stay empty.