From: Pierre-Yves Ritschard Date: Fri, 25 Jul 2014 14:04:08 +0000 (+0200) Subject: avoid possibility of muting log output X-Git-Tag: collectd-5.5.0~288^2~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a87a517e71a67d6972e082f42226d5b2bed82f19;p=collectd.git avoid possibility of muting log output --- diff --git a/src/log_logstash.c b/src/log_logstash.c index 4b7790c7..b9400461 100644 --- a/src/log_logstash.c +++ b/src/log_logstash.c @@ -61,7 +61,12 @@ static int log_logstash_config (const char *key, const char *value) if (0 == strcasecmp (key, "LogLevel")) { log_level = parse_log_severity(value); printf("parsed log level: %d\n", log_level); - if (log_level == -1) return 1; /* to keep previous behaviour */ + if (log_level < 0) { + log_level = LOG_INFO; + ERROR("log_logstash: invalid loglevel [%s] defaulting to 'info'", + value); + return 1; + } } else if (0 == strcasecmp (key, "File")) { sfree (log_file);