Prepend "ovs|" to syslog logs to make them easier to filter out of all
LOG_DAEMON logs.

Signed-off-by: Romain Lenglet <rleng...@vmware.com>
---
 NEWS               | 1 +
 lib/vlog.h         | 2 +-
 python/ovs/vlog.py | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index cbbe06b..39e6e5d 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,7 @@ post-v1.10.0
         NXM fields.
     - ovs-dpctl:
       * New debugging commands "add-flow", "mod-flow", "del-flow".
+    - New syslog format, prefixed with "ovs|", to be easier to filter.
 
 
 v1.10.0 - xx xxx xxxx
diff --git a/lib/vlog.h b/lib/vlog.h
index ab746c8..c7ab206 100644
--- a/lib/vlog.h
+++ b/lib/vlog.h
@@ -52,7 +52,7 @@ enum vlog_level vlog_get_level_val(const char *name);
 
 /* Facilities that we can log to. */
 #define VLOG_FACILITIES                                                 \
-    VLOG_FACILITY(SYSLOG, "%05N|%c%T|%p|%m")                            \
+    VLOG_FACILITY(SYSLOG, "ovs|%05N|%c%T|%p|%m")                            \
     VLOG_FACILITY(CONSOLE, "%D{%Y-%m-%dT%H:%M:%SZ}|%05N|%c%T|%p|%m")    \
     VLOG_FACILITY(FILE, "%D{%Y-%m-%dT%H:%M:%SZ}|%05N|%c%T|%p|%m")
 enum vlog_facility {
diff --git a/python/ovs/vlog.py b/python/ovs/vlog.py
index 7cfa415..75bf6d0 100644
--- a/python/ovs/vlog.py
+++ b/python/ovs/vlog.py
@@ -61,7 +61,7 @@ class Vlog:
             return
 
         now = datetime.datetime.utcnow().strftime("%Y-%m-%dT%H:%M:%SZ")
-        syslog_message = ("%s|%s|%s|%s"
+        syslog_message = ("ovs|%s|%s|%s|%s"
                            % (Vlog.__msg_num, self.name, level, message))
 
         level = LEVELS.get(level.lower(), logging.DEBUG)
-- 
1.8.1.3

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to