From: Zbigniew Jędrzejewski-Szmek Date: Thu, 22 Feb 2018 22:45:27 +0000 (+0100) Subject: basic/log: fix confusion with parameters to log_dispatch_internal X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=623a5e5a3a0c054d09b64f92bf4f5f257b5d5ff5;p=elogind.git 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. --- diff --git a/src/basic/log.c b/src/basic/log.c index 8398a326a..a11150513 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -591,8 +591,8 @@ int log_dispatch_internal( const char *func, const char *object_field, const char *object, - const char *extra, const char *extra_field, + const char *extra, char *buffer) { assert(buffer);