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-Tag: v238~60^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4dd09c6a1fc70f6bb0155661ab0a980b7a507986;p=platform%2Fupstream%2Fsystemd.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 bb60ce5..85f8eea 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -577,8 +577,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);