basic/log: fix confusion with parameters to log_dispatch_internal
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 22 Feb 2018 22:45:27 +0000 (23:45 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Feb 2018 10:13:24 +0000 (11:13 +0100)
commit4dd09c6a1fc70f6bb0155661ab0a980b7a507986
tree1205ec6fef1e9b7465147669d09bc14fa25e8308
parent2af42b9a787371b6ed2787a663e1149314322777
basic/log: fix confusion with parameters to log_dispatch_internal

log_dispatch_internal has only one caller where the extra_field/extra
params are not null: log_unit_full. When log_unit_full() was called,
when we got to log_dispatch_internal, our header would look like this:
PRIORITY=7
SYSLOG_FACILITY=3
CODE_FILE=../src/core/manager.c
CODE_LINE=2145
CODE_FUNC=manager_invoke_sigchld_event
USER_UNIT=gnome-terminal-server.service
65dffa7a3b984a6d9a46f0b8fb57710bUSER_INVOCATION_ID=
SYSLOG_IDENTIFIER=systemd

It took me a while to understand why I'm not seeing mangled messages in the
journal (after all, "" is a valid rvalue for log messages). The answer is that
journald rejects any field name which starts with a digit, and the MESSAGE_ID
that was used here starts with a digit. Hence, those lines would be silently
filtered out.
src/basic/log.c