#! /bin/sh /usr/share/dpatch/dpatch-run ## bts770694_loglevel.dpatch ## ## DP: Make sure not to disable logging on invalid log levels. ## DP: ## DP: Debug logging is not compiled into the Debian packages. Make sure to ## DP: fall back to INFO and report and error rather than silently dropping ## DP: all further log messages. ## DP: ## DP: Upstream bug report: ## DP: https://github.com/collectd/collectd/issues/636 ## DP: ## DP: Upstream commits: ## DP: https://github.com/dothebart/collectd/commit/84c3805 ## DP: https://github.com/collectd/collectd/commit/cb4ea71 @DPATCH@ diff a/src/logfile.c b/src/logfile.c --- 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 a/src/syslog.c b/src/syslog.c --- 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) {