How to change log directory on ROS2 Foxy?
Both variables ROS_HOME and ROS_LOG_DIR were empty. I set them both to the desired folder. Yet logs are being saved at the default folder ~/.ros/logs
Both variables ROS_HOME and ROS_LOG_DIR were empty. I set them both to the desired folder. Yet logs are being saved at the default folder ~/.ros/logs
I haven't seen any references to changing the log file directory, but there are two options:
On the "ROS2 Design" blog there is a pretty nice overview of ROS2 command-line arguments: here
If you were able to change a log file directory I would expect there to be a ros2 CLI argument, but on that page there is none. However as I mentioned above it does look like there is an unexplained "config file"
For external logging configuration, use
--log-config-file path/to/file.config
and a log configuration file.
The bad news is that I wasn't the first one to wonder about the lack of documentation for this config file: ROS2 Answers, "Documentation for ros2 log config?"
The poster received no response, and that was posted this January so it's fairly "recent".
I was also able to find another reference to logging from July 2019 regarding logging to a specific file: here
(User "alsora", July 22, 2019) By default, the messages will be also logged to a specific topic, named
rosout
. (This behavior can be disabled using the parameter__log_disable_rosout:=true
) So you can listen to them usingros2 topic echo /rosout
. An alternative is to userqt
which has plugins for reading and filtering logs
Please start posting anonymously - your entry will be published after you log in or create a new account.
Asked: 2021-05-13 12:05:24 -0500
Seen: 253 times
Last updated: May 13 '21
Micro ROS agent on Raspberry Pi 3
(Citadel ign gazebo+Foxy) How to control a single joint using diff driver?
rclpy: Change the output format of the default logger (RcutilsLogger)
rclcpp::Time() without nodehandles in ROS2 Foxy
Unable to get subscriber event call backs
[ROS2] Get rid of unnecessary info with launch_test
ROS2 Foxy : Unable to locate package ros-foxy-desktop