Log4cxx shutdown on ros::shutdown

asked 2021-07-01 01:42:30 -0500

clepz gravatar image

updated 2021-07-01 01:45:54 -0500

Hi, I want to use my own logger. However I can't use the logger after call ros::shutdown method. Console output is:

log4cxx: No appender could be found for logger (<logger_name>). log4cxx: Please initialize the log4cxx system properly.

I found that ros::shutdown calls ros::console::shutdown and It calls log4cxx::shutdown.

"By invoking ros::console::shutdown(); in C++ the logging subsystem is shut down and therefore no more logging occurs."

Log4cxx api docs for shutdown:

"Safely close and remove all appenders in all loggers including the root logger."

Therefore my own logger is closed too.

Isn't it a bad implementation? Why can't I use my own logger after ros::shutdown? Shouldn't there be a second way to close logger instead in ros::shutdown?

edit retag flag offensive close merge delete