ROS 2 logging rsyslog / FluentBit

ROS 2 Logging Subsystem

  • ROS 2 provides a flexible and configurable logging subsystem.
  • Supports multiple logging backends.
    • stdout: Logs are printed to the standard output (default ON to console).
    • rosout: Logs are published to the /rosout topic. (default ON)
    • external: default spdlog, or your own implementation. 🚀TODAY's TOPIC🚀
ROS 2 logging rsyslog / FluentBit

Enabling and Disabling Logging Backends

  • Node option in the program. (e.g rclcpp::NodeOptions)

  • Global ROS arguments via CLI. (can be overridden by NodeOptions)

    # Disabling rosout log publisher
    ros2 run foo_pkg bar_exec --ros-args --disable-rosout-logs
    
    # Disabling console output
    ros2 run foo_pkg bar_exec --ros-args --disable-stdout-logs
    
    # Disable any external loggers
    ros2 run foo_pkg bar_exec --ros-args --disable-external-lib-logs
    
ROS 2 logging rsyslog / FluentBit

Logging Severity Level

  • DEBUG, INFO, WARN, ERROR and FATAL.
  • A logger will only process log messages with severity at or higher than a specified level chosen for the logger.
  • Logger names represent a hierarchy.
    • If the level of a logger named abc.def is unset, it will defer to the level of its parent named abc, and if that level is also unset, the global default logger level will be used. When the level of logger abc is changed, all of its descendants (e.g. abc.def, abc.ghi.jkl) will have their level impacted unless their level has been explicitly set.
ROS 2 logging rsyslog / FluentBit

For more information about ROS 2 logging...

ROS 2 logging rsyslog / FluentBit

rcl_logging_syslog

ROS 2 logging rsyslog / FluentBit
ROS 2 logging rsyslog / FluentBit

Objectives

  • Configure log behavior without code change.
  • Multiple sink with different logging level filtering.
  • Reasonable Performance.
  • Log data pipeline and forward capability support.
  • Enabling ROS 2 logging system with Cloud-Native Log Management and Observability.
ROS 2 logging rsyslog / FluentBit
ROS 2 logging rsyslog / FluentBit

Demo FluentBit

ROS 2 logging rsyslog / FluentBit

Demo Fluentd/Loki/Grafana

ROS 2 logging rsyslog / FluentBit

rsyslog

a.k.a rocket-fast system for log processing 🚀🚀🚀

rsyslog is available in default Ubuntu distribution managed by system service, performative, and many configuration supported including log data pipeline.
So that user can choose the logging configuration depending on the application requirement and use case, sometimes file system sink, sometimes forwarding to remote rsyslogd, or even FluentBit.

ROS 2 logging rsyslog / FluentBit

FluentBit

ROS 2 logging rsyslog / FluentBit
  • Lightweight and Efficient: suitable for environments with limited computational power.
  • High Performance: capable of handling high-volume data streams with minimal latency. It leverages asynchronous I/O and efficient data processing techniques to ensure optimal performance.
  • Flexibility: supports a wide range of data sources and destinations.
  • Extensibility: highly extensible through plugins including custom ones.
  • Scalability: easily scaled horizontally to handle increasing data volumes by deploying multiple instances.
  • Reliability: features like fault tolerance and retry mechanisms to ensure data reliability.
ROS 2 logging rsyslog / FluentBit

How to use

export RCL_LOGGING_IMPLEMENTATION=rcl_logging_syslog
colcon build --symlink-install --cmake-clean-cache --packages-select rcl_logging_syslog rcl
  • The pain is we always need to build for now... we cannot choose the external logger at runtime...
  • Feature Request: Select the logger without rebuilding, hopefully i could fix this in next release 🤔🤔🤔
  • If you use docker, either binding -v /dev/log:/dev/log or enable rsyslogd in the container.
ROS 2 logging rsyslog / FluentBit

Issues and PRs always welcome 🚀

source code, documentation, presentation slides, everything is here.

https://github.com/fujitatomoya/rcl_logging_syslog

Comment Here

Comment Here

Comment Here

Comment Here

Comment Here

All available distributions are supported.

Comment Here

This logging design is just one of the example can be supported by the architecture. rsyslog and FluentBit enables user to support any log data pipeline with security TLS. Even more, this architecture can take advantage of Cloud-Native services and tools.

Comment Here

Comment Here

SYSLOG(3) is really simple that does not have much interfaces to control on application side, it just writes the log data on rsyslog Unix Domain Socket.

This is just the logging data pipeline only. For the final destination like data base, that likely is dependent on application business logics. For example, InfluxDB, ElasticSearch and so on, that are out of scope from this project.

Comment Here

Comment Here

Comment Here