Code

syslog plugin: Parse "value" as severity, not "key".
authorFlorian Forster <octo@collectd.org>
Sat, 25 Feb 2012 16:25:50 +0000 (17:25 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 25 Feb 2012 16:25:50 +0000 (17:25 +0100)
Change-Id: I4a7bde018be5a8925c9a998cd3e89e0289453063

src/syslog.c

index fc34e56c29cc6d00b4f953a2550139ca611df20f..d584eec905a03560228e05afac03e41769c42edd 100644 (file)
@@ -33,7 +33,7 @@ static int log_level = LOG_DEBUG;
 #else
 static int log_level = LOG_INFO;
 #endif /* COLLECT_DEBUG */
-static int notif_severity = -1;
+static int notif_severity = 0;
 
 static const char *config_keys[] =
 {
@@ -47,11 +47,14 @@ static int sl_config (const char *key, const char *value)
        if (strcasecmp (key, "LogLevel") == 0)
        {
                log_level = parse_log_severity (value);
-               if (log_level == -1) return (1);
+               if (log_level < 0)
+                       return (1);
        }
        else if (strcasecmp (key, "NotifyLevel") == 0)
        {
-               notif_severity = parse_notif_severity(key);
+               notif_severity = parse_notif_severity (value);
+               if (notif_severity < 0)
+                       return (1);
        }
 
        return (0);