[PATCH] logger: make unix socket logging to use syslog_local format by default

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The message format when writing to local sockets were inconsistent since
commit 4de2e8a, for example:

$ ./logger --stderr test
<5>Mär  4 11:03:30 logger: test

$ ./logger --socket /dev/log --stderr test
<5>1 2015-03-04T11:03:31.699841+0100 ubuntu1404esp rger - [timeQuality ...

This change makes the --socket  format to default use the same format as
the first message, as what used to be the case earlier.  Notice that
full-blown RFC format on the log socket causes problems with receivers
who do not expect such format, like rsyslog.

Addresses: https://github.com/karelzak/util-linux/issues/157
Reported-by: Rainer Gerhards <rgerhards@xxxxxxxxxxx>
Signed-off-by: Sami Kerola <kerolasa@xxxxxx>
---
 misc-utils/logger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index 1e7e2dc..04d2453 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -484,7 +484,7 @@ static void logger_open(struct logger_ctl *ctl)
 	if (ctl->unix_socket) {
 		ctl->fd = unix_socket(ctl, ctl->unix_socket, ctl->socket_type);
 		if (!ctl->syslogfp)
-			ctl->syslogfp = syslog_rfc5424;
+			ctl->syslogfp = syslog_local;
 		return;
 	}
 	ctl->fd = unix_socket(ctl, _PATH_DEVLOG, ctl->socket_type);
-- 
2.3.1

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux