# What is the log mechanism plan in ROS2?

**URL:** <https://discourse.openrobotics.org/t/what-is-the-log-mechanism-plan-in-ros2/4074>\
**Category:** ROS General\
**Created:** [March 1, 2018, 6:06am UTC](https://discourse.openrobotics.org/t/what-is-the-log-mechanism-plan-in-ros2/4074 "2018-03-01T06:06:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![echotor](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/echotor/32/1750_2.png) [@echotor](https://discourse.openrobotics.org/u/echotor)\
**Post date:** [March 1, 2018, 6:06am UTC](https://discourse.openrobotics.org/t/what-is-the-log-mechanism-plan-in-ros2/4074/1 "2018-03-01T06:06:45Z")

</div>

In version Ardent of ROS2, the log mechanism is not complete. No file create.  
What is the development plan for log mechanism in ROS2?

---

<div class="post-metadata">

**Author:** ![dirk-thomas](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/dirk-thomas/32/4328_2.png) [@dirk-thomas](https://discourse.openrobotics.org/u/dirk-thomas)\
**Post date:** [March 2, 2018, 5:43pm UTC](https://discourse.openrobotics.org/t/what-is-the-log-mechanism-plan-in-ros2/4074/2 "2018-03-02T17:43:55Z")

</div>

We are aware that it is a useful feature currently missing. While it is enumerated on the [roadmap](https://github.com/ros2/ros2/wiki/Roadmap) it is currently not actively being worked on.

---

<div class="post-metadata">

**Author:** ![rreignier](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rreignier](https://discourse.openrobotics.org/u/rreignier)\
**Post date:** [March 2, 2018, 6:01pm UTC](https://discourse.openrobotics.org/t/what-is-the-log-mechanism-plan-in-ros2/4074/3 "2018-03-02T18:01:52Z")

</div>

About logging to a file, on ROS 1, we have disabled this mechanism, tell every node to log to `screen` and then used systemd’s journal to log the system on our robots.

So, while waiting for this feature in ROS2, if you are on Linux, you may try a system-wide logging system.

---

<div class="post-metadata">

**Author:** ![Humpelstilzchen](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/humpelstilzchen/32/692_2.png) [@Humpelstilzchen](https://discourse.openrobotics.org/u/Humpelstilzchen)\
**Post date:** [March 2, 2018, 6:45pm UTC](https://discourse.openrobotics.org/t/what-is-the-log-mechanism-plan-in-ros2/4074/4 "2018-03-02T18:45:13Z")

</div>

Whats for those without systemd? Can we log to syslog?

---

<div class="post-metadata">

**Author:** ![rreignier](https://avatars.discourse-cdn.com/v4/letter/r/ec9cab/32.png) [@rreignier](https://discourse.openrobotics.org/u/rreignier)\
**Post date:** [March 2, 2018, 7:27pm UTC](https://discourse.openrobotics.org/t/what-is-the-log-mechanism-plan-in-ros2/4074/5 "2018-03-02T19:27:35Z")

</div>

It will be a bit more tricky because systemd directly uses stdout and stderr to log in the journal.

---

<div class="post-metadata">

**Author:** ![Humpelstilzchen](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/humpelstilzchen/32/692_2.png) [@Humpelstilzchen](https://discourse.openrobotics.org/u/Humpelstilzchen)\
**Post date:** [March 2, 2018, 7:50pm UTC](https://discourse.openrobotics.org/t/what-is-the-log-mechanism-plan-in-ros2/4074/6 "2018-03-02T19:50:26Z")

</div>

I read that as “ros2 works without systemd”, just won’t have logging. Which would be good, have not tested that yet.

For syslog, logging might be possible to hack with the “logger” command as a short term solution.

I like the idea of using the logging system from the OS since it is usually better documented, e.g. I always missed [tuning the timestamp output](https://answers.ros.org/question/236155/format-console-timestamp/) of the ros1 logger.

---

<div class="post-metadata">

**Author:** ![wjwwood](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/wjwwood/32/13715_2.png) [@wjwwood](https://discourse.openrobotics.org/u/wjwwood)\
**Post date:** [March 2, 2018, 11:11pm UTC](https://discourse.openrobotics.org/t/what-is-the-log-mechanism-plan-in-ros2/4074/7 "2018-03-02T23:11:49Z")

</div>

> [@Humpelstilzchen](#):
>
> I read that as “ros2 works without systemd”, just won’t have logging.

To be clear, we will probably have some file logging at some point in the future that is separate from a system logger, just because during development you often do not use the system logger day to day. For production system that makes sense though, and because of that it should be possible to disable file logging in favor of just printing to stdout/stderr.

---

<div class="post-metadata">

**Author:** ![gbiggs](https://sea2.discourse-cdn.com/flex022/user_avatar/discourse.openrobotics.org/gbiggs/32/30361_2.png) [@gbiggs](https://discourse.openrobotics.org/u/gbiggs)\
**Post date:** [March 13, 2018, 12:56am UTC](https://discourse.openrobotics.org/t/what-is-the-log-mechanism-plan-in-ros2/4074/8 "2018-03-13T00:56:59Z")

</div>

There is an increasing number of tools in the web development world that provide flexible logging, which might be able to handle both development and production logging. One of our people did an extensive review of them all a few months ago. I will need to talk to him to find out how they compare to the “traditional” ones like log4cpp.
