[libvirt] [PATCH] Log all errors at level INFO to stop polluting syslog

Daniel P. Berrange berrange at redhat.com
Mon Nov 22 14:11:46 UTC 2010


Everytime a public API returns an error, libvirtd pollutes
syslog with that error message. Reduce the error logging
level to INFO so these don't appear by default.

* src/util/virterror.c: Log all errors at INFO
---
 src/util/virterror.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/src/util/virterror.c b/src/util/virterror.c
index d524d04..ecd9fc9 100644
--- a/src/util/virterror.c
+++ b/src/util/virterror.c
@@ -64,18 +64,6 @@ void *virUserData = NULL;        /* associated data */
     }}								\
 }
 
-static virLogPriority virErrorLevelPriority(virErrorLevel level) {
-    switch (level) {
-        case VIR_ERR_NONE:
-            return(VIR_LOG_INFO);
-        case VIR_ERR_WARNING:
-            return(VIR_LOG_WARN);
-        case VIR_ERR_ERROR:
-            return(VIR_LOG_ERROR);
-    }
-    return(VIR_LOG_ERROR);
-}
-
 static const char *virErrorDomainName(virErrorDomain domain) {
     const char *dom = "unknown";
     switch (domain) {
@@ -719,7 +707,7 @@ virRaiseErrorFull(virConnectPtr conn ATTRIBUTE_UNUSED,
      * Hook up the error or warning to the logging facility
      * XXXX should we include filename as 'category' instead of domain name ?
      */
-    virLogMessage(virErrorDomainName(domain), virErrorLevelPriority(level),
+    virLogMessage(virErrorDomainName(domain), VIR_LOG_INFO,
                   funcname, linenr, 1, "%s", str);
 
     /*
-- 
1.7.2.3




More information about the libvir-list mailing list