summaryrefslogtreecommitdiff
path: root/include/openvswitch/vlog.h
diff options
context:
space:
mode:
authorAnsis Atteka <aatteka@nicira.com>2015-06-13 17:22:15 -0700
committerAnsis Atteka <aatteka@nicira.com>2015-06-27 12:38:33 -0700
commitfe089c0d1e180c37a89167728c7cb5ac31867f23 (patch)
tree6de83fb53a52a46e4d72e75f5643b918fe040e49 /include/openvswitch/vlog.h
parent5bb08b0ef605a9b164399bd74a194ae1b921c3ea (diff)
downloadopenvswitch-fe089c0d1e180c37a89167728c7cb5ac31867f23.tar.gz
vlog: abstract out interface to syslog daemon
This patch helps to address two issues that are present on Ubuntu 15.04 (and most likely other Linux distributions) where rsyslog daemon is configured to relay log messages from OVS to a remote log collector and syslog format being used is something other than the one defined in RFC 3164. These two issues are: 1. libc syslog() function always adds RFC 3164 prefix to syslog messages before sending them over /dev/log Unix domain socket. This does not allow us to use libc syslog() function to log in RFC 5424 format; and 2. rsyslogd daemon that comes with Ubuntu 15.04 is too old and uses hardcoded syslog message parser when it received messages over /dev/log UNIX domain socket. Solution to those two issues would be to use the newly introduced --syslog-method=udp:127.0.0.1:514 command line argument when starting OVS. Signed-off-by: Ansis Atteka <aatteka@nicira.com> Acked-by: Ben Pfaff <blp@nicira.com>
Diffstat (limited to 'include/openvswitch/vlog.h')
-rw-r--r--include/openvswitch/vlog.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/openvswitch/vlog.h b/include/openvswitch/vlog.h
index 680fba428..f2fedae31 100644
--- a/include/openvswitch/vlog.h
+++ b/include/openvswitch/vlog.h
@@ -143,6 +143,9 @@ void vlog_set_pattern(enum vlog_destination, const char *pattern);
int vlog_set_log_file(const char *file_name);
int vlog_reopen_log_file(void);
+/* Configure method how vlog should send messages to syslog server. */
+void vlog_set_syslog_method(const char *method);
+
/* Configure syslog target. */
void vlog_set_syslog_target(const char *target);
@@ -229,11 +232,13 @@ void vlog_rate_limit(const struct vlog_module *, enum vlog_level,
/* Command line processing. */
#define VLOG_OPTION_ENUMS \
OPT_LOG_FILE, \
+ OPT_SYSLOG_IMPL, \
OPT_SYSLOG_TARGET
#define VLOG_LONG_OPTIONS \
{"verbose", optional_argument, NULL, 'v'}, \
{"log-file", optional_argument, NULL, OPT_LOG_FILE}, \
+ {"syslog-method", optional_argument, NULL, OPT_SYSLOG_IMPL}, \
{"syslog-target", required_argument, NULL, OPT_SYSLOG_TARGET}
#define VLOG_OPTION_HANDLERS \
@@ -243,6 +248,9 @@ void vlog_rate_limit(const struct vlog_module *, enum vlog_level,
case OPT_LOG_FILE: \
vlog_set_log_file(optarg); \
break; \
+ case OPT_SYSLOG_IMPL: \
+ vlog_set_syslog_method(optarg); \
+ break; \
case OPT_SYSLOG_TARGET: \
vlog_set_syslog_target(optarg); \
break;