From 4d678fcef08782638f6b6ae8086c8f2f67920d75 Mon Sep 17 00:00:00 2001 From: Tobias Deiminger Date: Sun, 12 Sep 2021 15:20:04 +0200 Subject: [PATCH] Add available feature journald.conf in /etc Similar to the other loggers, add a predefined object JournaldLogger in features-available that will log messages >= warning, with default facility LOG_USER. It is disabled by default, and can be enabled with: $ sudo icing2 feature enable journald --- etc/CMakeLists.txt | 3 +++ etc/icinga2/features-available/journald.conf | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 etc/icinga2/features-available/journald.conf diff --git a/etc/CMakeLists.txt b/etc/CMakeLists.txt index ff138bd4c..40e181a0a 100644 --- a/etc/CMakeLists.txt +++ b/etc/CMakeLists.txt @@ -39,6 +39,9 @@ install_if_not_exists(icinga2/features-available/debuglog.conf ${ICINGA2_CONFIGD install_if_not_exists(icinga2/features-available/mainlog.conf ${ICINGA2_CONFIGDIR}/features-available) if(NOT WIN32) install_if_not_exists(icinga2/features-available/syslog.conf ${ICINGA2_CONFIGDIR}/features-available) + if(HAVE_SYSTEMD) + install_if_not_exists(icinga2/features-available/journald.conf ${ICINGA2_CONFIGDIR}/features-available) + endif() else() install_if_not_exists(icinga2/features-available/windowseventlog.conf ${ICINGA2_CONFIGDIR}/features-available) endif() diff --git a/etc/icinga2/features-available/journald.conf b/etc/icinga2/features-available/journald.conf new file mode 100644 index 000000000..e0b36f7cf --- /dev/null +++ b/etc/icinga2/features-available/journald.conf @@ -0,0 +1,7 @@ +/** + * The JournaldLogger type writes log information to the systemd journal. + */ + +object JournaldLogger "journald" { + severity = "warning" +}