Skip to content

Logging

Tristan Israël edited this page Feb 16, 2026 · 3 revisions

This page describes the logging strategy and the mechanisms implemented.

Features

Logging occurs at two levels:

  • Operating system: services can record a number of events in files located in /var/log or send them to a log manager such as syslog.
  • Business application: applications and the platform generate events related to the operation of the product.

Only business events are covered in this documentation.

Architecture

Logging can be achieved in multiple ways:

  • the system messaging infrastructure using specific topics system/events/#. See Protocol.
  • the API using the Logging Helper class. See API.
  • syslog-ng using the package safecor-syslog.

Using the API

Debug Level

The debug level is set using the command system/events/set_loglevel.

Emit an event log

Sharing log information is done via notifications system/events/[loglevel] where loglevel can be:

  • debug: Debugging information
  • info: General information
  • warn: Warning
  • error: Software error impacting only part of the system functions
  • critical: Software or hardware error preventing the system from operating

Recording

The platform automatically saves all events at or above the level defined by the set_loglevel command (or info by default) into a file that can be copied or downloaded on demand. The logging level can be configured to keep only a subset of events.

Export the Log

The command to retrieve the log is system/events/save_log.

Using the API

Event emission is simplified through the Python class Logger.

Here are examples:

Logger().debug("Debug message", "Module name")
Logger().info("Informational message")

Clone this wiki locally