icinga2/lib
Tobias Deiminger 173caa42aa Add a JournaldLogger
As proposed in #8857, this adds a Logger subclass that writes structured
log messages via journald's native protocol by calling sd_journal_sendv.
The feature therefore depends on the systemd library. sd_journal_sendv is
available since the early days (systemd v38), so a version check is
probably superflous.

We add the following fields to each record:
- MESSAGE: The log message
- PRIORITY (aka severity): Numeric severity as in RFC5424 section 6.2.1
- SYSLOG_FACILITY: Numeric facility as in RFC5424 section 6.2.1
- SYSLOG_IDENTIFIER: If provided, use value from configuration.
  Else use systemd's default behaior, which is to determine the field
  by using libc's program_invocation_short_name, resulting in "icinga2".
- ICINGA2_FACILITY: Facility as in Log::Log(..., String facility, ...),
  e.g. "ApiListener"
- some more fields are added automatically by systemd

Fields are stored indexed, so we can do fast queries for certain field
values. Example:

$ journalctl -t icinga2 ICINGA2_FACILITY=ApiListener -n 5

Syslog compatiblity is ratained because good old tag, severity and facility
is stored along, and systemd can forward to syslog daemons.

See also https://systemd.io/JOURNAL_NATIVE_PROTOCOL/.
2021-09-23 16:08:11 +02:00
..
base Add a JournaldLogger 2021-09-23 16:08:11 +02:00
checker Merge pull request #8601 from Icinga/feature/replace-std-boost-bind-with-lambdas-7006 2021-03-18 17:56:13 +01:00
cli Merge pull request #7874 from Icinga/feature/sd_notify-7329 2021-06-28 18:20:15 +02:00
compat Merge pull request #8447 from Icinga/feature/deprecated-relative-removal 2021-06-22 12:05:33 +02:00
config Rename silent parameter of ConfigItem::ActivateItems() 2021-06-21 16:07:36 +02:00
db_ido Merge pull request #8855 from Icinga/bugfix/inconsistent-ido-schema-versions-8852 2021-07-14 18:09:27 +02:00
db_ido_mysql Merge pull request #8425 from Icinga/bugfix/hosts-128-characters-7472 2021-07-16 18:34:29 +02:00
db_ido_pgsql IDO PgSQL: always use regular string literals 2021-08-05 11:39:32 +02:00
icinga Introduce Checkable#GetLastComment() 2021-07-29 12:10:42 +02:00
icingadb Merge pull request from GHSA-cxfm-8j5v-5qr2 2021-08-19 13:52:29 +02:00
livestatus Merge pull request #8601 from Icinga/feature/replace-std-boost-bind-with-lambdas-7006 2021-03-18 17:56:13 +01:00
methods Replace std/boost::bind() function with lambda expression 2021-03-10 16:29:40 +01:00
mysql_shim account for adjusted interface of mysql8 (now utilizes c99 bools instead of my_bool labelled chars) 2019-04-29 00:18:15 +02:00
notification Notifications: Make sure not to send reminder notification, if problem notification has been suppressed 2021-03-30 15:32:49 +02:00
perfdata GelfWriter: show error message of exceptions 2021-08-13 17:24:24 +02:00
pgsql_shim Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +01:00
remote Merge pull request #8946 from Icinga/bugfix/old-packages 2021-08-02 20:27:27 +02:00
CMakeLists.txt Rename ICINGA2_WITH_REDIS to ICINGA2_WITH_ICINGADB 2019-11-02 14:00:24 +01:00