Blame SOURCES/0001-syslog-avoid-duplicate-log-messages.patch

7bae85
From 720ddd02100ab8592e081aed425c9455b397a462 Mon Sep 17 00:00:00 2001
7bae85
From: Sumit Bose <sbose@redhat.com>
7bae85
Date: Thu, 25 Nov 2021 14:36:10 +0100
7bae85
Subject: [PATCH] syslog: avoid duplicate log messages
7bae85
7bae85
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2024248
7bae85
---
7bae85
 service/realm-diagnostics.c | 8 ++++++++
7bae85
 1 file changed, 8 insertions(+)
7bae85
7bae85
diff --git a/service/realm-diagnostics.c b/service/realm-diagnostics.c
7bae85
index 850b2e3..6aa5288 100644
7bae85
--- a/service/realm-diagnostics.c
7bae85
+++ b/service/realm-diagnostics.c
7bae85
@@ -55,12 +55,20 @@ log_syslog_and_debug (GDBusMethodInvocation *invocation,
7bae85
 	while ((ptr = memchr (at, '\n', length)) != NULL) {
7bae85
 		*ptr = '\0';
7bae85
 		if (line_buffer && line_buffer->len > 0) {
7bae85
+#ifdef WITH_JOURNAL
7bae85
+			/* Call realm_daemon_syslog directly to add
7bae85
+			 * REALMD_OPERATION to the jounrnal */
7bae85
 			realm_daemon_syslog (operation, log_level, "%s%s", line_buffer->str, at);
7bae85
+#else
7bae85
 			g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s%s", line_buffer->str, at);
7bae85
+#endif
7bae85
 			g_string_set_size (line_buffer, 0);
7bae85
 		} else {
7bae85
+#ifdef WITH_JOURNAL
7bae85
 			realm_daemon_syslog (operation, log_level, "%s", at);
7bae85
+#else
7bae85
 			g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, "%s", at);
7bae85
+#endif
7bae85
 		}
7bae85
 
7bae85
 		*ptr = '\n';
7bae85
-- 
7bae85
2.34.1
7bae85