summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5c57fce)
raw | patch | inline | side by side (parent: 5c57fce)
author | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 30 Jul 2007 20:43:26 +0000 (22:43 +0200) | ||
committer | Florian Forster <octo@leeloo.lan.home.verplant.org> | |
Mon, 30 Jul 2007 20:43:26 +0000 (22:43 +0200) |
ChangeLog | patch | blob | history | |
src/syslog.c | patch | blob | history |
diff --git a/ChangeLog b/ChangeLog
index 25dcc3ee1925f1f52be9f5321e27ba4555ff3c3a..465701d503b7512b1b56d5d0908a07ec3c4cb8a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
instance' was used to match against the list, but the documentation
told otherwise. This release fixes the code, so it complies with the
documentation.
+ * syslog plugin: Call `openlog' right when the plugin is loaded, so
+ configuration messages will end up in the logging facility.
2007-07-05, Version 4.0.5
* Portability: More fixes for OpenBSD have been included.
diff --git a/src/syslog.c b/src/syslog.c
index 08dadcb9b49a8d17cca6fa846ab0b2ab61df84f2..a21bef18e180a3c63c1bf6966effc77f26a0518b 100644 (file)
--- a/src/syslog.c
+++ b/src/syslog.c
# 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[] =
{
return (0);
} /* int sl_config */
-static int sl_init (void)
-{
- openlog ("collectd", LOG_CONS | LOG_PID, LOG_DAEMON);
-
- return (0);
-}
-
static void sl_log (int severity, const char *msg)
{
if (severity > log_level)
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);
} /* void module_register(void) */