xenserver: ovs-external-ids log to file instead of syslog
authorEthan Jackson <ethan@nicira.com>
Fri, 1 Oct 2010 02:29:27 +0000 (02:29 +0000)
committerEthan Jackson <ethan@nicira.com>
Tue, 5 Oct 2010 01:12:56 +0000 (01:12 +0000)
ovs-external-ids was crashing on startup because it was brought up
before /dev/log exists.  The simplest solution to this problem is
to have it log to /var/log/openvswitch/ovs-external-ids.log .  This
is consistent with vswitchd and ovsdb-server.

Signed-off-by: Ethan Jackson <ethan@nicira.com>
xenserver/usr_share_openvswitch_scripts_ovs-external-ids

index fc27aaae1a4df5a80cf1ce711034f3c05f6dc897..13c644f0bdf5ab47290744c3eb65e37e28c209c1 100755 (executable)
@@ -37,12 +37,12 @@ import ovs.daemon
 import ovs.db.idl
 
 s_log     = logging.getLogger("ovs-external-ids")
-l_handler = logging.handlers.SysLogHandler(
-        "/dev/log",
-        facility=logging.handlers.SysLogHandler.LOG_DAEMON)
+l_handler = logging.handlers.RotatingFileHandler(
+        "/var/log/openvswitch/ovs-external-ids.log")
 l_formatter = logging.Formatter('%(filename)s: %(levelname)s: %(message)s')
 l_handler.setFormatter(l_formatter)
 s_log.addHandler(l_handler)
+s_log.setLevel(logging.INFO)
 
 vsctl="/usr/bin/ovs-vsctl"
 session = None