2 This file is part of systemd.
4 Copyright 2010 Lennart Poettering
6 systemd is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published by
8 the Free Software Foundation; either version 2.1 of the License, or
9 (at your option) any later version.
11 systemd is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public License
17 along with systemd; If not, see <http://www.gnu.org/licenses/>.
28 #include <sys/signalfd.h>
29 #include <sys/socket.h>
36 #include "sd-messages.h"
38 #include "alloc-util.h"
40 #include "format-util.h"
45 #include "parse-util.h"
46 #include "proc-cmdline.h"
47 #include "process-util.h"
48 #include "signal-util.h"
49 #include "socket-util.h"
50 #include "stdio-util.h"
51 #include "string-table.h"
52 #include "string-util.h"
53 #include "syslog-util.h"
54 #include "terminal-util.h"
55 #include "time-util.h"
58 #define SNDBUF_SIZE (8*1024*1024)
60 static LogTarget log_target = LOG_TARGET_CONSOLE;
61 static int log_max_level[] = {LOG_INFO, LOG_INFO};
62 assert_cc(ELEMENTSOF(log_max_level) == _LOG_REALM_MAX);
63 static int log_facility = LOG_DAEMON;
65 static int console_fd = STDERR_FILENO;
66 static int syslog_fd = -1;
67 static int kmsg_fd = -1;
68 static int journal_fd = -1;
70 static bool syslog_is_stream = false;
72 static bool show_color = false;
73 static bool show_location = false;
75 #if 0 /// UNNEEDED by elogind
76 static bool upgrade_syslog_to_journal = false;
78 static bool always_reopen_console = false;
80 /* Akin to glibc's __abort_msg; which is private and we hence cannot
82 static char *log_abort_msg = NULL;
84 void log_close_console(void) {
91 safe_close(console_fd);
97 static int log_open_console(void) {
102 if (always_reopen_console) {
103 console_fd = open_terminal("/dev/console", O_WRONLY|O_NOCTTY|O_CLOEXEC);
107 console_fd = STDERR_FILENO;
112 void log_close_kmsg(void) {
113 kmsg_fd = safe_close(kmsg_fd);
116 static int log_open_kmsg(void) {
121 kmsg_fd = open("/dev/kmsg", O_WRONLY|O_NOCTTY|O_CLOEXEC);
128 void log_close_syslog(void) {
129 syslog_fd = safe_close(syslog_fd);
132 static int create_log_socket(int type) {
136 fd = socket(AF_UNIX, type|SOCK_CLOEXEC, 0);
140 (void) fd_inc_sndbuf(fd, SNDBUF_SIZE);
142 /* We need a blocking fd here since we'd otherwise lose
143 messages way too early. However, let's not hang forever in the
144 unlikely case of a deadlock. */
146 timeval_store(&tv, 10 * USEC_PER_MSEC);
148 timeval_store(&tv, 10 * USEC_PER_SEC);
149 (void) setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
154 static int log_open_syslog(void) {
156 static const union sockaddr_union sa = {
157 .un.sun_family = AF_UNIX,
158 .un.sun_path = "/dev/log",
166 syslog_fd = create_log_socket(SOCK_DGRAM);
172 if (connect(syslog_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0) {
173 safe_close(syslog_fd);
175 /* Some legacy syslog systems still use stream
176 * sockets. They really shouldn't. But what can we
178 syslog_fd = create_log_socket(SOCK_STREAM);
184 if (connect(syslog_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0) {
189 syslog_is_stream = true;
191 syslog_is_stream = false;
200 void log_close_journal(void) {
201 #if 0 /// elogind does not support journald
202 journal_fd = safe_close(journal_fd);
206 #if 0 /// UNNEEDED by elogind
207 static int log_open_journal(void) {
209 static const union sockaddr_union sa = {
210 .un.sun_family = AF_UNIX,
211 .un.sun_path = "/run/systemd/journal/socket",
219 journal_fd = create_log_socket(SOCK_DGRAM);
220 if (journal_fd < 0) {
225 if (connect(journal_fd, &sa.sa, SOCKADDR_UN_LEN(sa.un)) < 0) {
241 /* Do not call from library code. */
243 /* If we don't use the console we close it here, to not get
244 * killed by SAK. If we don't use syslog we close it here so
245 * that we are not confused by somebody deleting the socket in
246 * the fs. If we don't use /dev/kmsg we still keep it open,
247 * because there is no reason to close it. */
249 if (log_target == LOG_TARGET_NULL) {
256 if (!IN_SET(log_target, LOG_TARGET_AUTO, LOG_TARGET_SAFE) ||
258 isatty(STDERR_FILENO) <= 0) {
260 #if 0 /// elogind does not support logging to systemd-journald
261 if (IN_SET(log_target, LOG_TARGET_AUTO,
262 LOG_TARGET_JOURNAL_OR_KMSG,
263 LOG_TARGET_JOURNAL)) {
264 r = log_open_journal();
273 if (IN_SET(log_target, LOG_TARGET_SYSLOG_OR_KMSG,
274 LOG_TARGET_SYSLOG)) {
275 r = log_open_syslog();
283 if (IN_SET(log_target, LOG_TARGET_AUTO,
285 LOG_TARGET_JOURNAL_OR_KMSG,
286 LOG_TARGET_SYSLOG_OR_KMSG,
301 return log_open_console();
304 void log_set_target(LogTarget target) {
306 assert(target < _LOG_TARGET_MAX);
308 #if 0 /// elogind does not support logging to systemd-journald
309 if (upgrade_syslog_to_journal) {
310 if (target == LOG_TARGET_SYSLOG)
311 target = LOG_TARGET_JOURNAL;
312 else if (target == LOG_TARGET_SYSLOG_OR_KMSG)
313 target = LOG_TARGET_JOURNAL_OR_KMSG;
320 void log_close(void) {
321 /* Do not call from library code. */
329 #if 0 /// UNNEEDED by elogind
330 void log_forget_fds(void) {
331 /* Do not call from library code. */
333 console_fd = kmsg_fd = syslog_fd = journal_fd = -1;
337 void log_set_max_level_realm(LogRealm realm, int level) {
338 assert((level & LOG_PRIMASK) == level);
339 assert(realm < ELEMENTSOF(log_max_level));
341 log_max_level[realm] = level;
344 void log_set_facility(int facility) {
345 log_facility = facility;
348 static int write_to_console(
354 const char *buffer) {
356 char location[256], prefix[1 + DECIMAL_STR_MAX(int) + 2];
357 struct iovec iovec[6] = {};
364 if (log_target == LOG_TARGET_CONSOLE_PREFIXED) {
365 xsprintf(prefix, "<%i>", level);
366 IOVEC_SET_STRING(iovec[n++], prefix);
369 highlight = LOG_PRI(level) <= LOG_ERR && show_color;
372 snprintf(location, sizeof(location), "(%s:%i) ", file, line);
373 IOVEC_SET_STRING(iovec[n++], location);
377 IOVEC_SET_STRING(iovec[n++], ANSI_HIGHLIGHT_RED);
378 IOVEC_SET_STRING(iovec[n++], buffer);
380 IOVEC_SET_STRING(iovec[n++], ANSI_NORMAL);
381 IOVEC_SET_STRING(iovec[n++], "\n");
383 if (writev(console_fd, iovec, n) < 0) {
385 if (errno == EIO && getpid() == 1) {
387 /* If somebody tried to kick us from our
388 * console tty (via vhangup() or suchlike),
389 * try to reconnect */
397 if (writev(console_fd, iovec, n) < 0)
406 static int write_to_syslog(
412 const char *buffer) {
414 char header_priority[2 + DECIMAL_STR_MAX(int) + 1],
416 header_pid[4 + DECIMAL_STR_MAX(pid_t) + 1];
417 struct iovec iovec[5] = {};
418 struct msghdr msghdr = {
420 .msg_iovlen = ELEMENTSOF(iovec),
428 xsprintf(header_priority, "<%i>", level);
430 t = (time_t) (now(CLOCK_REALTIME) / USEC_PER_SEC);
435 if (strftime(header_time, sizeof(header_time), "%h %e %T ", tm) <= 0)
438 xsprintf(header_pid, "["PID_FMT"]: ", getpid());
440 IOVEC_SET_STRING(iovec[0], header_priority);
441 IOVEC_SET_STRING(iovec[1], header_time);
442 IOVEC_SET_STRING(iovec[2], program_invocation_short_name);
443 IOVEC_SET_STRING(iovec[3], header_pid);
444 IOVEC_SET_STRING(iovec[4], buffer);
446 /* When using syslog via SOCK_STREAM separate the messages by NUL chars */
447 if (syslog_is_stream)
453 n = sendmsg(syslog_fd, &msghdr, MSG_NOSIGNAL);
457 if (!syslog_is_stream ||
458 (size_t) n >= IOVEC_TOTAL_SIZE(iovec, ELEMENTSOF(iovec)))
461 IOVEC_INCREMENT(iovec, ELEMENTSOF(iovec), n);
467 static int write_to_kmsg(
473 const char *buffer) {
475 char header_priority[2 + DECIMAL_STR_MAX(int) + 1],
476 header_pid[4 + DECIMAL_STR_MAX(pid_t) + 1];
477 struct iovec iovec[5] = {};
482 xsprintf(header_priority, "<%i>", level);
483 xsprintf(header_pid, "["PID_FMT"]: ", getpid());
485 IOVEC_SET_STRING(iovec[0], header_priority);
486 IOVEC_SET_STRING(iovec[1], program_invocation_short_name);
487 IOVEC_SET_STRING(iovec[2], header_pid);
488 IOVEC_SET_STRING(iovec[3], buffer);
489 IOVEC_SET_STRING(iovec[4], "\n");
491 if (writev(kmsg_fd, iovec, ELEMENTSOF(iovec)) < 0)
497 #if 0 /// UNNEEDED by elogind
498 static int log_do_header(
503 const char *file, int line, const char *func,
504 const char *object_field, const char *object,
505 const char *extra_field, const char *extra) {
507 snprintf(header, size,
509 "SYSLOG_FACILITY=%i\n"
516 "SYSLOG_IDENTIFIER=%s\n",
519 isempty(file) ? "" : "CODE_FILE=",
520 isempty(file) ? "" : file,
521 isempty(file) ? "" : "\n",
522 line ? "CODE_LINE=" : "",
523 line ? 1 : 0, line, /* %.0d means no output too, special case for 0 */
525 isempty(func) ? "" : "CODE_FUNC=",
526 isempty(func) ? "" : func,
527 isempty(func) ? "" : "\n",
528 error ? "ERRNO=" : "",
529 error ? 1 : 0, error,
531 isempty(object) ? "" : object_field,
532 isempty(object) ? "" : object,
533 isempty(object) ? "" : "\n",
534 isempty(extra) ? "" : extra_field,
535 isempty(extra) ? "" : extra,
536 isempty(extra) ? "" : "\n",
537 program_invocation_short_name);
542 static int write_to_journal(
548 const char *object_field,
550 const char *extra_field,
552 const char *buffer) {
554 char header[LINE_MAX];
555 struct iovec iovec[4] = {};
556 struct msghdr mh = {};
561 log_do_header(header, sizeof(header), level, error, file, line, func, object_field, object, extra_field, extra);
563 IOVEC_SET_STRING(iovec[0], header);
564 IOVEC_SET_STRING(iovec[1], "MESSAGE=");
565 IOVEC_SET_STRING(iovec[2], buffer);
566 IOVEC_SET_STRING(iovec[3], "\n");
569 mh.msg_iovlen = ELEMENTSOF(iovec);
571 if (sendmsg(journal_fd, &mh, MSG_NOSIGNAL) < 0)
578 int log_dispatch_internal(
584 const char *object_field,
587 const char *extra_field,
595 if (log_target == LOG_TARGET_NULL)
598 /* Patch in LOG_DAEMON facility if necessary */
599 if ((level & LOG_FACMASK) == 0)
600 level = log_facility | LOG_PRI(level);
606 buffer += strspn(buffer, NEWLINE);
611 if ((e = strpbrk(buffer, NEWLINE)))
614 #if 0 /// elogind does not support logging to systemd-journald
615 if (IN_SET(log_target, LOG_TARGET_AUTO,
616 LOG_TARGET_JOURNAL_OR_KMSG,
617 LOG_TARGET_JOURNAL)) {
619 k = write_to_journal(level, error, file, line, func, object_field, object, extra_field, extra, buffer);
628 if (IN_SET(log_target, LOG_TARGET_SYSLOG_OR_KMSG,
629 LOG_TARGET_SYSLOG)) {
631 k = write_to_syslog(level, error, file, line, func, buffer);
640 IN_SET(log_target, LOG_TARGET_AUTO,
642 LOG_TARGET_SYSLOG_OR_KMSG,
643 LOG_TARGET_JOURNAL_OR_KMSG,
646 k = write_to_kmsg(level, error, file, line, func, buffer);
654 (void) write_to_console(level, error, file, line, func, buffer);
662 int log_dump_internal(
670 LogRealm realm = LOG_REALM_REMOVE_LEVEL(level);
673 /* This modifies the buffer... */
678 if (_likely_(LOG_PRI(level) > log_max_level[realm]))
681 return log_dispatch_internal(level, error, file, line, func, NULL, NULL, NULL, NULL, buffer);
684 int log_internalv_realm(
693 LogRealm realm = LOG_REALM_REMOVE_LEVEL(level);
694 char buffer[LINE_MAX];
700 if (_likely_(LOG_PRI(level) > log_max_level[realm]))
703 /* Make sure that %m maps to the specified error */
707 vsnprintf(buffer, sizeof(buffer), format, ap);
709 return log_dispatch_internal(level, error, file, line, func, NULL, NULL, NULL, NULL, buffer);
712 int log_internal_realm(
718 const char *format, ...) {
723 va_start(ap, format);
724 r = log_internalv_realm(level, error, file, line, func, format, ap);
730 int log_object_internalv(
736 const char *object_field,
738 const char *extra_field,
749 if (_likely_(LOG_PRI(level) > log_max_level[LOG_REALM_SYSTEMD]))
752 /* Make sure that %m maps to the specified error */
756 /* Prepend the object name before the message */
761 buffer = newa(char, n + 2 + LINE_MAX);
762 b = stpcpy(stpcpy(buffer, object), ": ");
764 b = buffer = newa(char, LINE_MAX);
766 vsnprintf(b, LINE_MAX, format, ap);
768 return log_dispatch_internal(level, error, file, line, func,
769 object_field, object, extra_field, extra, buffer);
772 int log_object_internal(
778 const char *object_field,
780 const char *extra_field,
782 const char *format, ...) {
787 va_start(ap, format);
788 r = log_object_internalv(level, error, file, line, func, object_field, object, extra_field, extra, format, ap);
794 static void log_assert(
800 const char *format) {
802 static char buffer[LINE_MAX];
803 LogRealm realm = LOG_REALM_REMOVE_LEVEL(level);
805 if (_likely_(LOG_PRI(level) > log_max_level[realm]))
808 DISABLE_WARNING_FORMAT_NONLITERAL;
809 snprintf(buffer, sizeof buffer, format, text, file, line, func);
812 log_abort_msg = buffer;
814 log_dispatch_internal(level, 0, file, line, func, NULL, NULL, NULL, NULL, buffer);
817 noreturn void log_assert_failed_realm(
823 log_assert(LOG_REALM_PLUS_LEVEL(realm, LOG_CRIT), text, file, line, func,
824 "Assertion '%s' failed at %s:%u, function %s(). Aborting.");
828 noreturn void log_assert_failed_unreachable_realm(
834 log_assert(LOG_REALM_PLUS_LEVEL(realm, LOG_CRIT), text, file, line, func,
835 "Code should not be reached '%s' at %s:%u, function %s(). Aborting.");
839 void log_assert_failed_return_realm(
846 log_assert(LOG_REALM_PLUS_LEVEL(realm, LOG_DEBUG), text, file, line, func,
847 "Assertion '%s' failed at %s:%u, function %s(). Ignoring.");
850 int log_oom_internal(LogRealm realm, const char *file, int line, const char *func) {
851 log_internal_realm(LOG_REALM_PLUS_LEVEL(realm, LOG_ERR),
852 ENOMEM, file, line, func, "Out of memory.");
856 int log_format_iovec(
860 bool newline_separator,
865 static const char nl = '\n';
867 while (format && *n + 1 < iovec_len) {
872 /* We need to copy the va_list structure,
873 * since vasprintf() leaves it afterwards at
874 * an undefined location */
880 r = vasprintf(&m, format, aq);
885 /* Now, jump enough ahead, so that we point to
886 * the next format string */
887 VA_FORMAT_ADVANCE(format, ap);
889 IOVEC_SET_STRING(iovec[(*n)++], m);
891 if (newline_separator) {
892 iovec[*n].iov_base = (char*) &nl;
893 iovec[*n].iov_len = 1;
897 format = va_arg(ap, char *);
902 int log_struct_internal(
908 const char *format, ...) {
912 LogRealm realm = LOG_REALM_REMOVE_LEVEL(level);
919 if (_likely_(LOG_PRI(level) > log_max_level[realm]))
922 if (log_target == LOG_TARGET_NULL)
925 if ((level & LOG_FACMASK) == 0)
926 level = log_facility | LOG_PRI(level);
928 #if 0 /// elogind does not support logging to systemd-journald
929 if (IN_SET(log_target, LOG_TARGET_AUTO,
930 LOG_TARGET_JOURNAL_OR_KMSG,
931 LOG_TARGET_JOURNAL) &&
933 char header[LINE_MAX];
934 struct iovec iovec[17] = {};
940 bool fallback = false;
942 /* If the journal is available do structured logging */
943 log_do_header(header, sizeof(header), level, error, file, line, func, NULL, NULL, NULL, NULL);
944 IOVEC_SET_STRING(iovec[n++], header);
946 va_start(ap, format);
947 r = log_format_iovec(iovec, ELEMENTSOF(iovec), &n, true, error, format, ap);
952 (void) sendmsg(journal_fd, &mh, MSG_NOSIGNAL);
956 for (i = 1; i < n; i += 2)
957 free(iovec[i].iov_base);
964 /* Fallback if journal logging is not available or didn't work. */
966 va_start(ap, format);
974 vsnprintf(buf, sizeof(buf), format, aq);
977 if (startswith(buf, "MESSAGE=")) {
982 VA_FORMAT_ADVANCE(format, ap);
984 format = va_arg(ap, char *);
991 return log_dispatch_internal(level, error, file, line, func, NULL, NULL, NULL, NULL, buf + 8);
994 int log_set_target_from_string(const char *e) {
997 t = log_target_from_string(e);
1005 int log_set_max_level_from_string_realm(LogRealm realm, const char *e) {
1008 t = log_level_from_string(e);
1012 log_set_max_level_realm(realm, t);
1016 static int parse_proc_cmdline_item(const char *key, const char *value, void *data) {
1019 * The systemd.log_xyz= settings are parsed by all tools, and
1022 * However, "quiet" is only parsed by PID 1, and only turns of
1023 * status output to /dev/console, but does not alter the log
1027 if (streq(key, "debug") && !value)
1028 log_set_max_level(LOG_DEBUG);
1030 else if (proc_cmdline_key_streq(key, "systemd.log_target")) {
1032 if (proc_cmdline_value_missing(key, value))
1035 if (log_set_target_from_string(value) < 0)
1036 log_warning("Failed to parse log target '%s'. Ignoring.", value);
1038 } else if (proc_cmdline_key_streq(key, "systemd.log_level")) {
1040 if (proc_cmdline_value_missing(key, value))
1043 if (log_set_max_level_from_string(value) < 0)
1044 log_warning("Failed to parse log level '%s'. Ignoring.", value);
1046 } else if (proc_cmdline_key_streq(key, "systemd.log_color")) {
1048 if (log_show_color_from_string(value ?: "1") < 0)
1049 log_warning("Failed to parse log color setting '%s'. Ignoring.", value);
1051 } else if (proc_cmdline_key_streq(key, "systemd.log_location")) {
1053 if (log_show_location_from_string(value ?: "1") < 0)
1054 log_warning("Failed to parse log location setting '%s'. Ignoring.", value);
1060 void log_parse_environment_realm(LogRealm realm) {
1061 /* Do not call from library code. */
1065 if (get_ctty_devnr(0, NULL) < 0)
1066 /* Only try to read the command line in daemons. We assume that anything that has a controlling tty is
1068 (void) proc_cmdline_parse(parse_proc_cmdline_item, NULL, PROC_CMDLINE_STRIP_RD_PREFIX);
1070 e = getenv("SYSTEMD_LOG_TARGET");
1071 if (e && log_set_target_from_string(e) < 0)
1072 log_warning("Failed to parse log target '%s'. Ignoring.", e);
1074 e = getenv("SYSTEMD_LOG_LEVEL");
1075 if (e && log_set_max_level_from_string_realm(realm, e) < 0)
1076 log_warning("Failed to parse log level '%s'. Ignoring.", e);
1078 e = getenv("SYSTEMD_LOG_COLOR");
1079 if (e && log_show_color_from_string(e) < 0)
1080 log_warning("Failed to parse bool '%s'. Ignoring.", e);
1082 e = getenv("SYSTEMD_LOG_LOCATION");
1083 if (e && log_show_location_from_string(e) < 0)
1084 log_warning("Failed to parse bool '%s'. Ignoring.", e);
1087 LogTarget log_get_target(void) {
1091 int log_get_max_level_realm(LogRealm realm) {
1092 return log_max_level[realm];
1095 void log_show_color(bool b) {
1099 bool log_get_show_color(void) {
1103 void log_show_location(bool b) {
1107 bool log_get_show_location(void) {
1108 return show_location;
1111 int log_show_color_from_string(const char *e) {
1114 t = parse_boolean(e);
1122 int log_show_location_from_string(const char *e) {
1125 t = parse_boolean(e);
1129 log_show_location(t);
1133 bool log_on_console(void) {
1134 if (IN_SET(log_target, LOG_TARGET_CONSOLE,
1135 LOG_TARGET_CONSOLE_PREFIXED))
1138 return syslog_fd < 0 && kmsg_fd < 0 && journal_fd < 0;
1141 static const char *const log_target_table[_LOG_TARGET_MAX] = {
1142 [LOG_TARGET_CONSOLE] = "console",
1143 [LOG_TARGET_CONSOLE_PREFIXED] = "console-prefixed",
1144 [LOG_TARGET_KMSG] = "kmsg",
1145 #if 0 /// elogind does not support logging to systemd-journald
1146 [LOG_TARGET_JOURNAL] = "journal",
1147 [LOG_TARGET_JOURNAL_OR_KMSG] = "journal-or-kmsg",
1149 [LOG_TARGET_SYSLOG] = "syslog",
1150 [LOG_TARGET_SYSLOG_OR_KMSG] = "syslog-or-kmsg",
1151 [LOG_TARGET_AUTO] = "auto",
1152 [LOG_TARGET_SAFE] = "safe",
1153 [LOG_TARGET_NULL] = "null"
1156 DEFINE_STRING_TABLE_LOOKUP(log_target, LogTarget);
1158 #if 0 /// UNNEEDED by elogind
1159 void log_received_signal(int level, const struct signalfd_siginfo *si) {
1160 if (si->ssi_pid > 0) {
1161 _cleanup_free_ char *p = NULL;
1163 get_process_comm(si->ssi_pid, &p);
1166 "Received SIG%s from PID %"PRIu32" (%s).",
1167 signal_to_string(si->ssi_signo),
1168 si->ssi_pid, strna(p));
1172 signal_to_string(si->ssi_signo));
1176 void log_set_upgrade_syslog_to_journal(bool b) {
1177 upgrade_syslog_to_journal = b;
1181 int log_syntax_internal(
1184 const char *config_file,
1185 unsigned config_line,
1190 const char *format, ...) {
1193 char buffer[LINE_MAX];
1195 const char *unit_fmt = NULL;
1200 if (_likely_(LOG_PRI(level) > log_max_level[LOG_REALM_SYSTEMD]))
1203 if (log_target == LOG_TARGET_NULL)
1209 va_start(ap, format);
1210 vsnprintf(buffer, sizeof(buffer), format, ap);
1214 unit_fmt = getpid() == 1 ? "UNIT=%s" : "USER_UNIT=%s";
1216 return log_struct_internal(
1217 LOG_REALM_PLUS_LEVEL(LOG_REALM_SYSTEMD, level),
1220 "MESSAGE_ID=" SD_MESSAGE_INVALID_CONFIGURATION_STR,
1221 "CONFIG_FILE=%s", config_file,
1222 "CONFIG_LINE=%u", config_line,
1223 LOG_MESSAGE("%s:%u: %s", config_file, config_line, buffer),
1228 #if 0 /// UNNEEDED by elogind
1229 void log_set_always_reopen_console(bool b) {
1230 always_reopen_console = b;