# include <syslog.h>
#endif
+#if COLLECT_DEBUG
static int log_level = LOG_DEBUG;
+#else
+static int log_level = LOG_INFO;
+#endif /* COLLECT_DEBUG */
static const char *config_keys[] =
{
log_level = LOG_NOTICE;
else if (strcasecmp (value, "info") == 0)
log_level = LOG_INFO;
-#if COLLECTD_DEBUG
+#if COLLECT_DEBUG
else if (strcasecmp (value, "debug") == 0)
log_level = LOG_DEBUG;
#endif
return (0);
} /* int sl_config */
-static int sl_init (void)
+static void sl_log (int severity, const char *msg)
{
- openlog ("collectd", LOG_CONS | LOG_PID, LOG_DAEMON);
-
- return (0);
-}
-
-static void sl_log (int sevetiry, const char *msg)
-{
- if (sevetiry > log_level)
+ if (severity > log_level)
return;
- syslog (sevetiry, "%s", msg);
+ syslog (severity, "%s", msg);
} /* void sl_log */
static int sl_shutdown (void)
void module_register (void)
{
+ openlog ("collectd", LOG_CONS | LOG_PID, LOG_DAEMON);
+
plugin_register_config ("syslog", sl_config, config_keys, config_keys_num);
- plugin_register_init ("syslog", sl_init);
plugin_register_log ("syslog", sl_log);
plugin_register_shutdown ("syslog", sl_shutdown);
-
- return;
} /* void module_register(void) */