[libvirt] [PATCH 0/5] Structured error logging and syslog support

Miloslav Trmač mitr at redhat.com
Wed Oct 17 18:17:13 UTC 2012


This is sort of a v2 of the "Structured syslog" series.

Patches 1-4 allow callers virLogMessage to add arbitrary additional data,
and use it in virRaiseErrorFull and its callers.  This data is sent
to journal (and ignored for other outputs).

Because the additional fields for errors include virErrorDomain and
virErrorNumber, this allows _programs_ to _automatically_ detect the event
and react to it, perhaps alerting the user.


Patch 5 adds the "syslog/json" log output type, in a way that is comparably
async-signal-safe to the other log outputs (i.e. it's not safe by the letter
of the standard, but safe in practice).  I still think that having this
format output is desirable, but I'll accept it if you decide that it is
not wanted in libvirt.


Miloslav Trmač (5):
  Add a metadata parameter to virLog{,V}Message
  Add metadata to virLogOutputFunc
  Use helper functions to format the journal iov array
  Add detailed error information to journal
  Add "syslog/json" log output format.

 docs/logging.html.in |   3 +
 src/util/logging.c   | 445 +++++++++++++++++++++++++++++++++++++++++++--------
 src/util/logging.h   |  27 +++-
 src/util/viraudit.c  |   4 +-
 src/util/virterror.c |  33 +++-
 tests/testutils.c    |   1 +
 6 files changed, 437 insertions(+), 76 deletions(-)

-- 
1.7.11.7




More information about the libvir-list mailing list