Skip to content

Logging

Introduction

During development, test phase and at runtime it is very useful - and in case of problems essential - that an application publishes messages. These messages can be informations, diagnostics or errors according the event which triggered the message. These messages should be displayed and stored uniform.

We recommend to use the build-in Linux systemd logging service called journald.

The Using of Linux Kernel Log Levels

The interface to journald depends from the programming language. But for all these predefined Linux log levels (values) are common:

  1. EMERGENCY The system is unusable (and will be shut down)
  2. ALERT There is a severe error, action must be taken immediately
  3. CRITICAL There is a critical error
  4. ERROR A job was aborted in case of an error
  5. WARNING There is an abnormal condition but the actual job can be finished
  6. NOTICE There is a normal but significant condition
  7. INFO A messages informs about an internal state
  8. DEBUG Message shows details regarding program flow or results

Be carefull with level EMERGENCY: Messages with this level are sent to all consoles!

Logging Samples in the SDK

These folders of the ctrlX AUTOMATION SDK contain logging samples for different programming languages:

  • samples-cpp/diagnostics.logbook
  • samples-net/diagnostics.logbook
  • samples-python/python.logbook

Support

If you've any questions visit the ctrlX AUTOMATION Community


License

/*
 * SPDX-FileCopyrightText: Bosch Rexroth AG
 *
 * SPDX-License-Identifier: MIT
 */