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
..
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-06-29 17:52:25 +02:00
2020-02-11 17:26:15 +01:00
2019-02-25 14:48:22 +01:00
2021-03-10 16:29:40 +01:00
2019-07-12 14:36:55 +02:00
2019-07-12 14:36:55 +02:00
2020-07-07 18:24:06 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-09-23 16:08:11 +02:00
2019-02-25 14:48:22 +01:00
2021-03-10 16:29:40 +01:00
2019-08-13 15:05:47 +02:00
2020-07-07 18:24:06 +02:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2021-08-06 12:19:08 +02:00
2019-04-16 15:04:57 +02:00
2019-04-16 15:04:57 +02:00
2021-02-03 09:54:57 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-04-27 17:31:50 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-03-01 14:29:35 +01:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-03-01 14:07:09 +01:00
2021-03-01 14:06:47 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-03-10 16:29:40 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-10-21 17:10:51 +02:00
2019-02-25 14:48:22 +01:00
2021-03-10 16:29:40 +01:00
2021-03-10 16:29:40 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2020-06-17 10:31:40 +02:00
2020-06-17 10:31:40 +02:00
2021-09-23 16:08:11 +02:00
2021-09-23 16:08:11 +02:00
2021-09-23 16:08:11 +02:00
2019-10-21 17:10:51 +02:00
2021-04-30 15:49:52 +02:00
2019-02-25 14:48:22 +01:00
2019-05-24 16:25:32 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-06-21 15:15:54 +02:00
2021-06-21 15:15:54 +02:00
2021-06-23 16:57:44 +02:00
2019-10-21 17:10:51 +02:00
2019-02-25 14:48:22 +01:00
2019-10-21 17:10:51 +02:00
2019-10-21 17:10:51 +02:00
2019-10-21 16:12:35 +02:00
2019-10-21 16:12:35 +02:00
2019-02-25 14:48:22 +01:00
2019-05-29 14:17:36 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-03-23 13:13:47 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-03-18 17:56:13 +01:00
2019-04-17 18:26:29 +02:00
2019-04-17 18:26:29 +02:00
2019-04-17 18:26:29 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-06-08 12:37:13 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-07-27 17:57:19 +02:00
2021-01-14 12:00:11 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2019-10-21 17:10:51 +02:00
2019-02-25 14:48:22 +01:00
2019-10-21 17:10:51 +02:00
2019-02-25 14:48:22 +01:00
2021-03-10 16:29:40 +01:00
2019-11-08 11:13:26 +01:00
2019-05-01 12:09:24 +02:00
2019-06-28 09:07:33 +02:00
2020-12-25 23:27:08 +01:00
2020-12-25 23:27:08 +01:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2021-02-03 09:54:57 +01:00
2021-03-01 14:07:11 +01:00
2021-03-01 14:07:11 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-03-25 11:30:02 +01:00
2021-03-18 17:56:13 +01:00
2021-02-03 09:54:57 +01:00
2021-03-18 17:56:13 +01:00
2021-02-03 09:54:57 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2020-12-22 16:27:38 +01:00
2020-12-22 16:27:38 +01:00
2021-09-15 10:15:22 +02:00
2021-09-15 10:15:22 +02:00
2019-02-25 14:48:22 +01:00
2019-02-26 11:25:44 +01:00
2019-09-09 15:27:57 +02:00
2019-08-14 17:12:59 +02:00
2019-08-14 17:12:59 +02:00
2021-02-03 09:54:57 +01:00
2019-04-24 11:42:54 +02:00
2021-08-13 10:58:10 +02:00
2020-07-29 15:02:48 +02:00
2021-07-22 14:34:07 +02:00
2021-07-27 21:57:02 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-03-10 16:29:40 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-05-29 14:17:36 +02:00
2021-03-23 09:54:01 +01:00
2021-06-17 16:21:01 +02:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2019-02-25 14:48:22 +01:00
2021-06-21 15:15:54 +02:00
2021-06-21 15:15:54 +02:00
2021-06-21 15:15:54 +02:00
2021-06-21 15:15:54 +02:00
2021-03-18 17:56:13 +01:00
2021-07-26 11:40:43 +02:00