How to configure data logging
Set up data logging or publishing to send CAN bus messages or tag values to files, InfluxDB, Prometheus, a Message Queuing Telemetry Transport (MQTT) broker, or a webhook. Choose a destination in the table, then follow the steps on this page and the settings on that component's page. This page holds the steps every destination shares: adding the component, selecting tag collections, starting it, checking it, and fixing the common failures.
Prerequisites
- An active profile. The tags you log come from components already in the profile.
- Access to the destination: a file system or a Secure Shell (SSH) File Transfer Protocol (SFTP) server, InfluxDB, Prometheus, an MQTT broker, or a webhook receiver
- The Modify components permission, which allows loggers and publishers to be added
- The licensed feature in the What it needs column of the destination table, if any
Licensing lists the features of each edition.
Choose a destination
| Destination | Component | Category | What it needs |
|---|---|---|---|
| A file on the local file system | CAN File Logger (native CAN bus messages), TAG File Logger (tag values) | Loggers | No licensed feature |
| A file on an SFTP server | CAN SFTP Logger, TAG SFTP Logger | Loggers | No licensed feature |
| Local queryable history (managed SQLite) | TAG Local Historian | Historians | Historians |
| InfluxDB v1 | InfluxDB v1 Logger | Loggers | No licensed feature |
| InfluxDB v2 or v3 | InfluxDB v2 Historian, InfluxDB v3 Historian | Historians | Historians |
| SQL database you operate | TAG SQL Historian | Historians | Historians |
| Prometheus | Prometheus Logger | Loggers | No licensed feature |
| An MQTT broker | MQTT Publisher | Publishers & Subscribers | Data Relay |
| An HTTP(S) URL | Webhook Publisher | Publishers & Subscribers | Data Relay |
The TAG loggers log the values of the tags in selected tag collections. The Loggers and Historians write to a queryable store, so you can retrieve the data later, whatever the state of the live connection. You can also read Historian data back through the APIs.
The MQTT Publisher and Webhook Publisher push to a receiver that is listening at that moment. InfluxDB V1, V2, and V3 are separate, incompatible products, so the component must match the installed InfluxDB version.
For InfluxDB Cloud and the InfluxDB-side setup, refer to How to log data to InfluxDB. For recording tags to a file so they can be replayed, refer to Log tags to a file.
Add the component
- Select ADD COMPONENT in the side menu or on the home page.
- Select the logger or publisher type from the table in Choose a destination.
- Enter its settings, which the component page in the table lists, including the tag collections to log as described in Select tag collections.
- Select ADD COMPONENT at the bottom of the dialog. The button reads SAVE when you change the settings of an existing component.
A component whose licensed feature is missing shows as unavailable.
Select tag collections
The TAG File Logger, TAG SFTP Logger, TAG Local Historian, TAG SQL Historian, InfluxDB loggers and historians, Prometheus Logger and both publishers log only the tags in the collections you select.
- In Collections, add one or more tag collections to log or publish. The list shows each collection's display name, with its group path when it sits in a group, as described in Collections.
These components start only when at least one collection is configured.
Start the logger or publisher
Make sure the logger or publisher is added to the active profile. The Auto connect setting starts the component when the profile loads, and Connections and reconnecting describes its default. With Auto connect off, select Connect (or Start) on the component to start it. Its status shows On once it is running. Then check the component's status in the component list.
Check that data is flowing
- For file logging, look in the artefacts directory on the machine running Profinity (
can_bus_logs/for a CAN File Logger,tag_logs/<profile name>/<logger name>/for a TAG File Logger), or in the remote directory on the SFTP server, for new log files. Refer to Artefacts directory. - For InfluxDB or Prometheus, query the database, or the Prometheus server, to confirm that data is arriving, and check the status of the logger or historian component.
- For MQTT or a webhook, subscribe to the configured MQTT topic, or check the webhook receiver's own logs, to see published messages, and check the publisher's status for connection information.
Troubleshooting
Find the symptom in the first column, then follow the cause and the fix in the same row.
| What you see | Cause | What to do |
|---|---|---|
| No data is logged | A logger or publisher that writes nothing is usually inactive, or has no tag collection to log. | Check that the component is active. For a TAG logger, TAG Local Historian, TAG SQL Historian, InfluxDB, Prometheus, or a publisher, check that at least one tag collection is selected, because those components start only when a collection is configured. Then check that the components that feed the tags are receiving data. |
| A connection error appears | The destination is unreachable or rejects the credentials. | Check the network connection to the destination and the credentials. For InfluxDB, confirm that the component type matches the installed InfluxDB version, because the wrong component type causes connection failures. The Profinity logs record connection errors. |
| Gaps in logged data | Gaps usually come from a logging interval that is too long for the data, or from a component that stopped receiving data. | In Snapshot mode, a shorter Update interval (seconds) gives more detailed data. Logging modes describes what the other modes do with it. Also check that the component that supplies the data is receiving it. |
Next steps
Next, refer to Loggers for file, tag, InfluxDB, and Prometheus logger settings.