Robotics StackExchange | Archived questions

prevent rospy.loginfo from logging to file <node>-stdout.log

I have some python ROS nodes that logs purely with the rosout logger provided with rospy.loginfo etc. This means the same information ends up in two files, example:

  1. MyNode-123.log
  2. MyNode-123-stdout.log

Can I prevent the rosout data to go to the *-stdout.log file?

Besides being redundant, the stdout file has the disadvantage of not "rolling" when it gets large. I don't want to send the log data to the screen either.

Do I need to setup my own python_logging.conf? If so, I would appreciate a tip on how it might look.

(ROS melodic, Ubuntu 18.04)

Asked by knxa on 2019-03-06 09:03:29 UTC

Comments

So you just want to prevent the log files for the individual nodes from being created? Not disable logging entirely? Is this related to your other question (#q317030)?

Asked by gvdhoorn on 2019-03-06 09:13:00 UTC

No to all:

  1. I want one log file for each node. For the node MyNode I would like the MyNode-XXX.log, but not the redundant MyNode-stdout.log
  2. No, I do not want to disable logging entirely.
  3. No, the question #q317030 was about the aggregated log file created by the rosout node.

Asked by knxa on 2019-03-06 09:43:25 UTC

Edited question title for clarity

Asked by knxa on 2019-03-06 09:45:27 UTC

Answers