Bug 861437

Summary: RFE: logging: Rewrite syslog logging target to be async signal safe & more flexible
Product: [Community] Virtualization Tools Reporter: Daniel Berrangé <berrange>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED DEFERRED QA Contact:
Severity: high Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: berrange, crobinso, kchamart
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-15 13:38:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Daniel Berrangé 2012-09-28 15:30:02 UTC
Description of problem:
The current libvirt logging code support for outputting syslog, just uses the regular C library syslog() function. The problem is that this function is not async signal safe, mostly because of its use of the sprintf family of functions internally. Annoyingly libvirt does not even need printf support here, because it has already expanded the log message string.

Secondary problems are that syslog() only logs to a local syslog service. It might be desirable to let it log directly to a remote syslog over TCP or UDP.

The syslog protocol is very straightforward, so the use of syslog() could easily be replaced by direct sockets calls. The Perl Sys::Syslog module is a good reference for the ever so slightly varying requirements of each OS

Version-Release number of selected component (if applicable):
0.10.2

Comment 1 Cole Robinson 2016-03-23 22:50:41 UTC
Dan was this ever addressed, even indirectly? I still see syslog() calls in the code...

Comment 2 Daniel Berrangé 2016-03-29 09:05:57 UTC
No, we've not addressed it yet

Comment 4 Daniel Berrangé 2020-04-15 13:38:10 UTC
Re-filed at https://gitlab.com/libvirt/libvirt/-/issues/5