summaryrefslogtreecommitdiff
path: root/trace/control.c
diff options
context:
space:
mode:
authorPaul Durrant <paul.durrant@citrix.com>2016-08-04 14:44:14 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2016-09-05 13:47:01 -0400
commit0a852417564bc59441dc09509beacf7b49bc1e57 (patch)
treea27b04adbdaa3681d8797dab9097df2aca9464fd /trace/control.c
parente87d397e5ef66276ccc49b829527d605ca07d0ad (diff)
trace: add syslog tracing backend
This patch adds a tracing backend which sends output using syslog(). The syslog backend is limited to POSIX compliant systems. openlog() is called with facility set to LOG_DAEMON, with the LOG_PID option. Trace events are logged at level LOG_INFO. Signed-off-by: Paul Durrant <paul.durrant@citrix.com> Message-id: 1470318254-29989-1-git-send-email-paul.durrant@citrix.com Cc: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'trace/control.c')
-rw-r--r--trace/control.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/trace/control.c b/trace/control.c
index d173c09f44..b179cde9df 100644
--- a/trace/control.c
+++ b/trace/control.c
@@ -19,6 +19,9 @@
#ifdef CONFIG_TRACE_LOG
#include "qemu/log.h"
#endif
+#ifdef CONFIG_TRACE_SYSLOG
+#include <syslog.h>
+#endif
#include "qapi/error.h"
#include "qemu/error-report.h"
#include "qemu/config-file.h"
@@ -250,6 +253,10 @@ bool trace_init_backends(void)
}
#endif
+#ifdef CONFIG_TRACE_SYSLOG
+ openlog(NULL, LOG_PID, LOG_DAEMON);
+#endif
+
return true;
}