[ovs-dev] [PATCHv2 1/2] vlog: abstract out interface to syslog daemon

Ben Pfaff blp at nicira.com
Fri Jun 26 22:57:48 UTC 2015


On Thu, Jun 25, 2015 at 12:54:22PM -0700, Ansis Atteka wrote:
> 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 at nicira.com>

Thanks!

I guess that we will deprecate --syslog-target later.

The 'o' and 'b' in Signed-off-by are normally lowercase (some of the Git
tools don't recognize them properly in uppercase).

I think that syslog_libc_class and syslog_direct_class should be
declared static.

I think that the casts in vlog_set_syslog_method() can be removed.

I would tend to remove the casts in syslog_*_create() too, e.g.:

@@ -65,7 +65,7 @@ syslog_direct_create(const char *method)
         this->fd = -1;
     }
 
-    return (struct syslogger *)this;
+    return &this->parent;
 }
 
 static void

This might be a shorter way to express the usage, in vlog_usage():
  --syslog-method=(libc|unix:file|udp:ip:port)\n\
                           specify how to send messages to syslog daemon\n\

The formatted documentation looks better with indentation around the
bulleted list:

diff --git a/lib/vlog.man b/lib/vlog.man
index b08b6b8..6994eec 100644
--- a/lib/vlog.man
+++ b/lib/vlog.man
@@ -79,6 +79,7 @@ a hostname.
 .IP "\fB\-\-syslog\-method=\fImethod\fR"
 Specify \fImethod\fR how syslog messages should be sent to syslog daemon.
 Following forms are supported:
+.RS
 .IP \(bu
 \fBlibc\fR, use libc \fBsyslog()\fR function.  This is the default behavior.
 Downside of using this options is that libc adds fixed prefix to every
@@ -100,3 +101,4 @@ to listen on the specified UDP port, accidental iptables rules could be
 interfering with local syslog traffic and there are some security
 considerations that apply to UDP sockets, but do not apply to UNIX domain
 sockets.
+.RE

Acked-by: Ben Pfaff <blp at nicira.com>



More information about the dev mailing list