This allows the logging level to set as part of configuration, instead
of having to use the `-l` CLI option. This mean it can also be changed
dynamically when the config file is re-read for changes.
The existing syslog mask and msg level were essentially the same, as
setting the syslog mask was always also setting the msg level. Made
this more obvious by moving all the syslog handling code into the msg
module. This also give clean separation of responsibilities, and
reduces the code size, and makes the signal handlers simpler.
The significant change is dynamically allocate the ConfigManager so
that can be deleted explicitly, instead of when going out scope of
main, thus allowing for msg_shutdown to be called after this, as the
ConfigManager's destructor makes use of messaging. Being able to call
msg_shutdown mean syslog can be flushed/closed and pthread mutex not
left dangling.
Add new CLI options to support logging to Syslog and journald.
journald support is also behind a new CMake flag, SUPPORT_JOURNALD,
since it adds a dependency on libsystemd-journal.
Add --quiet, which will disable output to STDOUT/STDERR. Useful
when logging directly to the above mentioned loggers.
Add --log-level, to allow for mix and match log levels, for example
only warning and critical can be enabled together.
New usage output:
VERsatile MONitoring Tool - VERMONT
MANDATORY OPTIONS:
-f, --config-file FILE Use configuration file
OTHER OPTIONS:
-h, --help Display this help and exit
-d, --debug Log verbosity: -d NOTICE, -dd INFO,
-ddd DEBUG
-l, --log-level LEVEL Log level. Can be specified multiple
times and mix-matched.
In increasing order:
debug
info
notice
warning
error
critical
Default: critical, warning, error
-q, --quiet Do not write output to console
-b, --daemon Run in daemon mode (implies -q)
-p, --pid-file FILE Set process id filename (use with -d)
-u, --user USER Change user to USER (use with -d)
-g, --group GROUP Change group to GROUP (use with -d)
-s, --syslog Log to syslog
-j, --journald Log to journald
Add a number of new CLI options, which enable Vermont to run as an
old-style *nix daemon. These include forking itself in the
background, changing user and group id, and creating a PID file.
Useful when being run by a SysV Init script.
New help text:
VERsatile MONitoring Tool - VERMONT
MANDATORY OPTIONS:
-f, --config-file FILE Use configuration file
OTHER OPTIONS:
-h, --help Display this help and exit
-d, --debug Log verbosity: -d NOTICE, -dd INFO,
-ddd DEBUG
-b, --daemon Run in daemon mode (implies -q)
-p, --pid-file FILE Set process id filename (use with -d)
-u, --user USER Change user to USER (use with -d)
-g, --group GROUP Change group to GROUP (use with -d)
Removed DelayedDeleter/Reconnector.
If a module can't be reused after a reconfiguration, it will be shut down after a specific timeout.
Fixed some Segfaults.
git-svn-id: file:///Users/braun/svn/vermont/branches/vermont/new-template@2331 aef3b71b-58ee-0310-9ba9-8811b9f0742f