Package: collectd
Version: 5.4.1-5
Severity: important
Tags: patch

Dear Maintainer,

A fix for #687067 is available upstream. I believe it should be included
in the package shipped with jessie, as it prevents collectd from not
emiting any logs at all, including important notifications about
monitoring data which went out of bounds.

The fix consists of two patches, which I've merged together and I'm
attaching the resulting patch here for your convenience.

Thanks !
diff --git a/src/logfile.c b/src/logfile.c
index 0f20f3c..63448cb 100644
--- a/src/logfile.c
+++ b/src/logfile.c
@@ -54,7 +54,11 @@ static int logfile_config (const char *key, const char *value)
 {
 	if (0 == strcasecmp (key, "LogLevel")) {
 		log_level = parse_log_severity(value);
-		if (log_level == -1) return 1; /* to keep previous behaviour */
+		if (log_level < 0) {
+			log_level = LOG_INFO;
+			ERROR ("logfile: invalid loglevel [%s] defaulting to 'info'", value);
+			return (1);
+		}
 	}
 	else if (0 == strcasecmp (key, "File")) {
 		sfree (log_file);
diff --git a/src/syslog.c b/src/syslog.c
index 4f5d0c4..834ba79 100644
--- a/src/syslog.c
+++ b/src/syslog.c
@@ -48,7 +48,11 @@ static int sl_config (const char *key, const char *value)
 	{
 		log_level = parse_log_severity (value);
 		if (log_level < 0)
+		{
+			log_level = LOG_INFO;
+			ERROR ("syslog: invalid loglevel [%s] defaulting to 'info'", value);
 			return (1);
+		}
 	}
 	else if (strcasecmp (key, "NotifyLevel") == 0)
 	{

Reply via email to