From: Marc Fournier Date: Tue, 24 Jun 2014 15:47:08 +0000 (+0200) Subject: logfile: avoid total silence in case of a misconfiguration X-Git-Tag: collectd-5.5.0~289^2~1 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=cb4ea7112145fa91500b4d4518b83289acb80c2f;p=collectd.git logfile: avoid total silence in case of a misconfiguration Basically the same patch that was applied to syslog.c in 84c38056 --- diff --git a/src/logfile.c b/src/logfile.c index 0f20f3ca..63448cb6 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);