Ask Your Question

How do I stop roscpp from logging?

asked 2019-10-15 16:32:12 -0500

rubicks gravatar image

updated 2019-10-16 17:41:08 -0500

roscpp writes files under ${ROS_LOG_DIR:-${ROS_HOME:-${HOME}/.ros}/log}. Assuming an environment where there is no disk space and/or no mounted, writable volume, what can I do to stop roscpp from writing logs?

Here's some things I've tried that don't work:

  • export HOME=/nonexistent
  • export ROS_HOME=/dev/null
  • export ROS_LOG_DIR=/dev/null
  • export ROSCONSOLE_CONFIG_FILE=/tmp/rosconsole.config && echo "log4j.threshold=OFF" >$ROSCONSOLE_CONFIG_FILE

Here's something that _does_ work, but requires nullfs:

  • nullfs /mnt/ros-log-dir && export ROS_LOG_DIR=/mnt/ros-log-dir
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-10-16 01:49:39 -0500

gvdhoorn gravatar image

updated 2019-10-16 01:59:10 -0500

I've not verified whether this works, but according to wiki/rosconsole - Disable all logging:

7.1 With a configuration file

Create a custom rosconsole configuration file with the following content and use it as described above:


There have been users reporting difficulty using it though: #q292112.

It's also discussed in ros/ros_comm#139.

I seem to remember some files will still be created, but I'm not sure about that.

Edit: I believe ros/ros_comm#1425 is meant to fix that. Documented here: wiki/rosout - rosout.log:

rosout node by default logs all messages into rosout.log in the ROS log directory.

New in Melodic This can be disabled by setting environment variable ROSOUT_DISABLE_FILE_LOGGING to True when launching roscore.

edit flag offensive delete link more


I can confirm that, on my host with kinetic installed, the log4j.threshold=OFF within ${ROSCONSOLE_CONFIG_FILE} (which has also been exported) has no effect.

rubicks gravatar image rubicks  ( 2019-10-16 17:17:55 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-10-15 16:32:12 -0500

Seen: 409 times

Last updated: Oct 16 '19