You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are currently looking into rosconsole to find a way to directly write to the system journal using sd_journal_send. One could of course simply use the builtin feature of log4cxx to log to syslog and use the compatibility layer of systemd for syslog, but this comes with one big limitation: Syslog uses the program_invocation_short_name to identify the sender, which is not the perfect way to identify a program in a ROS context, especially when one has two instances of the same binary with different node names.
The big benefit of systemd's journal is that one can set the SYSLOG_IDENTIFIER. The obvious idea is to set this value to the node name which makes it really convenient to read the journal and I have code ready that does exactly this. Sadly this can't be done given the current dependency structure since the node name is only available in ros/this_node.h in roscpp which is a downstream package.
I started implementing what is needed for solution 2:
https://github.com/magazino/rosconsole/tree/log4cxx-appender registers the ROSConsoleStdioAppender class as a log4cxx appender which can be configured using the log4cxx config file. This would allow me to disable the print to stdout/stderr.
I don't know where to call REGISTER_ROSCONSOLE_BRIDGE and add rosconsole_bridge to forward the console bridge output of pluginlib. I was wondering why rosconsole_bridge is a separate package at all and not part of rosconsole.
Would be great to get some feedback on my ideas and how to move forward.
We are currently looking into rosconsole to find a way to directly write to the system journal using sd_journal_send. One could of course simply use the builtin feature of log4cxx to log to syslog and use the compatibility layer of systemd for syslog, but this comes with one big limitation: Syslog uses the program_invocation_short_name to identify the sender, which is not the perfect way to identify a program in a ROS context, especially when one has two instances of the same binary with different node names.
The big benefit of systemd's journal is that one can set the SYSLOG_IDENTIFIER. The obvious idea is to set this value to the node name which makes it really convenient to read the journal and I have code ready that does exactly this. Sadly this can't be done given the current dependency structure since the node name is only available in ros/this_node.h in roscpp which is a downstream package.
I'm opening this ticket to ask for advice on how to continue here. I've two suggestions:
I personally prefer solution 2 but this would of course be a significant change.
The text was updated successfully, but these errors were encountered: