]> xenbits.xensource.com Git - xen.git/commit
tools/oxenstored: Render backtraces more nicely in Syslog
authorAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 1 Dec 2022 21:06:25 +0000 (21:06 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 2 Dec 2022 13:41:04 +0000 (13:41 +0000)
commitd2162d884cba0ff7b2ac0d832f4e044444bda2e1
treef5a8f12aae5e6e8313e7b6a9fbbdc54810e1f6d6
parent133f35f0f0cd0a415e599c20156aaaa5598356c0
tools/oxenstored: Render backtraces more nicely in Syslog

fallback_exception_handler feeds a string with embedded newlines directly into
syslog().  While this is an improvement on getting nothing, syslogd escapes
all control characters it gets, and emits one (long) log line.

Fix the problem generally in the syslog stub.  As we already have a local copy
of the string, split it in place and emit one syslog() call per line.

Also tweak Logging.msg_of to avoid putting an extra newline on a string which
already ends with one.

Fixes: ee7815f49faf ("tools/oxenstored: Set uncaught exception handler")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
tools/ocaml/xenstored/logging.ml
tools/ocaml/xenstored/syslog_stubs.c