You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an option to disable creating log files by the launch system.
Feature description
We deploy a ROS application which uses the launch subsystem using docker containers. We try to follow well known industry guidelines like Heroku's 12-factor app https://12factor.net/logs. This guideline states that the application should not force creating log files but instead it should output log entries using standard streams. This makes a lot of sense, especially if you deploy the application to an embedded device with a flash storage that wears quickly with unnecessary writes.
At the moment is seems that there is no way to disable creating launch.log file as it is created unconditionally in the get_logger function of the launch system:
Unfortunately, it seems that the launch system is only the tip of the iceberg. There are various parts of the ROS ecosystem that unconditionally create log files. For example, in theory there is a possibility to disable creating log files in rclcpp/rclpy by adding --disable-external-lib-logs argument to the init function, but there are places like ros2 service where you cannot add this argument, so every successful call to ros2 service creates a file on disk.
We were able to remove creation of most of the log files by adding custom extensions to the launch system:
the ros2launch.option.OptionExtension type extension which:
patches the launch.logging.launch_config object by replacing FileHandler with NullHanlder,
patches the launch.logging.launch_config object by changing _log_dir to /tmp to prevent creation of subfolder for launch logs
replaces launch_ros.ros_adapters.get_ros_adapter function adding --disable-external-lib-logs to ROSAdapter initialization
the launch_ros.actions.node.NodeActionExtension type extension which adds --disable-external-lib-logs argument to launched nodes
but it is more a workaround than a proper solution and it doesn't solve the ros2 service case.
At this moment I think that the simplest solution would be to add to rclc/rclcpp/rclpy support for handling an environment variable like RCUTILS_USE_EXTERNAL_LIB_LOGS which could be set globally in the environment. And similar thing would be needed in the launch subsystem.
Feature request
Add an option to disable creating log files by the launch system.
Feature description
We deploy a ROS application which uses the launch subsystem using docker containers. We try to follow well known industry guidelines like Heroku's 12-factor app https://12factor.net/logs. This guideline states that the application should not force creating log files but instead it should output log entries using standard streams. This makes a lot of sense, especially if you deploy the application to an embedded device with a flash storage that wears quickly with unnecessary writes.
At the moment is seems that there is no way to disable creating launch.log file as it is created unconditionally in the get_logger function of the launch system:
launch/launch/launch/logging/__init__.py
Line 350 in d9ffd80
Implementation considerations
The text was updated successfully, but these errors were encountered: