Ask Your Question
0

How to send logging to log files?

asked 2017-02-17 14:22:30 -0500

SRD gravatar image

I have logging in my cpp files, like the following, and I'm trying to get the messages to appear in a file.

ROS_INFO_STREAM("testing");

I have these env vars to show where the logs should be placed, and how to config logging.

ROS_LOG_DIR = /tmp/node/etc/logs
ROSCONSOLE_CONFIG_FILE = /tmp/node/etc/rosconsole.config

And within the rosconsole.config file I have the following.

log4j.logger.ros=DEBUG

Any thoughts as to why I don't see my output in log files?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-11-05 20:35:24 -0500

rjosodtssp gravatar image

you should define it in the config file, like this

log4j.logger.ros.log_test=WARN,rosout_a log4j.appender.rosout_a=org.apache.log4j.RollingFileAppender log4j.appender.rosout_a.Threshold=WARN log4j.appender.rosout_a.Append=true log4j.appender.rosout_a.File=/home/name/output.txt

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2017-02-17 14:22:30 -0500

Seen: 96 times

Last updated: Feb 17 '17