ROS_LOG_DIR not affecting where logs are written - ROS2 Eloquent
I would like change the directory where ROS2 is storing logs. Here it indicates that setting the ROS_LOG_DIR environment variable overwrites the default log directory in ROS though I am not sure that it is the case with ROS2. I have tried setting the ROS_LOG_DIR environment variable but the log file location defaults to ~/.ros/log
.
I have also tried this in the official ROS docker container with the same result.
Is there a ROS2 method to change the directory in which logs are written?
My system details are as follows:
- OS - Ubuntu 18.04
- ROS version - ROS2 Eloquent
- CPU architecture - arm64
ROS environment variables:
ROS_LOG_DIR=/home/../Downloads/test_logs
ROS_PARAMS_PATH=/home/../../../package/launch/node_params.yaml
ROS_VERSION=2
ROS_LOCALHOST_ONLY=0
ROS_PYTHON_VERSION=3
ROS_PACKAGE_PATH=/home/../../../package/install/gps_umd/share
ROS_DISTRO=eloquent
Have you fixed this problem? I have encountered the same problem in ros2 foxy.
I never got a solution to the problem. I am running ROS in a Docker container and am just mapping the internal
/root/.ros
directory to a specific location outside the container to make the logs persistent.