#include "collectd.h"
-#include "common.h"
#include "plugin.h"
+#include "utils/common/common.h"
#if HAVE_SYSLOG_H
#include <syslog.h>
#else
static int log_level = LOG_INFO;
#endif /* COLLECT_DEBUG */
-static int notif_severity = 0;
+static int notif_severity;
static const char *config_keys[] = {
- "LogLevel", "NotifyLevel",
+ "LogLevel",
+ "NotifyLevel",
};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
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;
+ WARNING("syslog: invalid loglevel [%s] defaulting to 'info'", value);
}
} else if (strcasecmp(key, "NotifyLevel") == 0) {
notif_severity = parse_notif_severity(value);
- if (notif_severity < 0)
+ if (notif_severity < 0) {
+ ERROR("syslog: invalid notification severity [%s]", value);
return 1;
+ }
}
return 0;