-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Draft] Added syslog handler for launch log #737
base: rolling
Are you sure you want to change the base?
Conversation
Signed-off-by: Lennart Nachtigall <[email protected]>
Just a quick push, as I would really like to progress on these patches :) |
@clalancette assigned you to provide thoughts on Windows 🧇 |
@clalancette As I already wrote in ros2/rcl_logging#105 we could use the Event Log on Windows instead: https://docs.python.org/3/library/logging.handlers.html#nteventloghandler Additionally if desired by the user we could support writing to a remote Syslog server (The python logging handler implementation supports this in contrast to spdlog)
|
I found this interesting. Would you elaborate the decision process? Personally I prefer configuration of ROS itself (i.e. the destination of log that ROS generates, in this context) to be done in ROS level. But I want to hear other thoughts. |
@130s We use ROS for multiple industrial machines. At some point a central log server will be necessary and is also common industry practice. See the "Why do we need it section"
This is still the case. It is just as ROS level syslog is selected as sink. The way it is then further processed is up the setup of the syslog deamon. |
I guess I couldn't make the intent of my question clear enough. Let me retry. I did NOT ask why you want ROS to send logs to Instead, what I asked is why you chose
AFAIK I'm asking this as a non-blocking question for now. |
Sorry that I understood your question wrong.
Well thats what this patch is doing. You tell ROS send to syslog. |
On OS-level, sure. What I was saying is that I'd add an option somewhere in ROS, e.g. But, that's just my preference, which should be opened separately as a feature enhancement discussion. I saw your ros2/rcl_logging#105 (comment) and now I understand all these syslog improvement is on hold anyways. |
This PR adds initial support for writing to the syslog.
It goes hand in hand with: ros2/rcl_logging#105
In combination it allows to write the whole log a ros2 application creates to the syslog. Both PRs use 'local1' as facility which allows to redirect the whole log into a seperate log file or even a remote logging server without the need for additional configuration inside the ros2 logging system. (Everything can be configured in rsyslog.conf)
And also answers my question from #736
Why do we need it
In enterprise environments it can be desirable to store the whole application log on a remote logging server. Utilizing rsyslog for providing this functionality is an easy and established way.
Just grabbing
/rosout
won't suffice as we cannot grab all parts of the log.What is missing so far:
How to test it:
I redirected the 'local1' facility to
/var/log/local1.log
. This allows testing without spamming into your normal syslog.Edit
/etc/rsyslog.d/50-default.conf
And add the line:
Restart rsyslog
Afterwards you should see the most basic output written into the file.
Eg:
Some additional notes
The current implementation grabs on purpose only the parts of the log which can't be grabbed via rcl_logging (ros2/rcl_logging#105). Otherwise some log messages would occur twice in the syslog.