Data logging and Log File Access

Data logging can be started either manually or left to run automatically. Data logging is off by default but you can enable it by changing the “enabled” setting to 1 in the [datalogs] section of the sdc.ini file. SDC Tools will give you a means to edit the ini file, or you can use the new DataLogging dialog to do it.

When dataloggging is enabled, by default the system keeps the last 10 datalogs on the disk, regardless of their size. Every time SDC boots up it deletes the oldest log files until there are only 10 left. This setting can also be changed. See the datalogs ini file section for further details.

As of version 2.00, there is a datalogging configuration interface in SDC Tools, which makes it a bit easier to control the attributes that are being logged and the status of automatic logging.

If you plan to enable datalogging, then you should also implement controlled shutdown so that the datalogs can be closed before the power is removed from the device.

I do not recommend using an SD Card extension cable to make the SD card accessible outside of the Pi. There are many reports of these cables causing unreliability because the electrical signals between the card and the Pi are degraded by the un-shielded cable. You should only use the card plugged directly into the Pi, and access the logs via WiFi.

Datalog Configuration

The content of the datalog can be changed by altering the DataLog Settings

Accessing the Datalogs

Datalogs can be accessed in one of two ways:

  • You can remove the SD card from the device and plug it into your PC. If your Pi is embedded somewhere behind your dash then this obviously isn’t going to work, so you’re going to need the second option.
  • You can configure WIFI on the device, and then access the logs remotely.

Accessing log files directly from the SD Card

  • Plug the SD card into your PC’s card reader
  • Access the root of the drive
  • You will find a folder in the root called datalogs
  • Inside this folder is a set of files, each one starting with ‘dl’ and followed by a number.
  • Log files with the largest number are most recent

You can simply copy any log files you want to view onto your local hard disk and then use MegaLogViewer to open them.

Accessing log files via WIFI

  • Configure WIFI access and reboot the device
  • Find out what the IP address of the device is, either by looking at your router or using the SDC Tools Application.
  • Open a browser and access the following URL: http://<ip address>/datalogs
  • You should see a display similar to the image below. To download a log file, click on it.

If you want to know which log is currently active, open SDC Tools, connect to your device, and open the Data Logging dialog from the main window. If logging is active, this will show at the bottom of the Data Logging form, along with the filename currently being written to. The log file size is also available as an attribute called filesizestr which must be displayed using the Dynamic String Gauge.

You can download the currently active datalog but there may be an incomplete line at the end of it.