Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH] logger: make unix socket logging to use syslog_local format by default
@ 2015-03-05 21:12 Sami Kerola
  2015-03-06 11:56 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Sami Kerola @ 2015-03-05 21:12 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola, Rainer Gerhards

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@adiscon.com>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] logger: make unix socket logging to use syslog_local format by default
  2015-03-05 21:12 [PATCH] logger: make unix socket logging to use syslog_local format by default Sami Kerola
@ 2015-03-06 11:56 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2015-03-06 11:56 UTC (permalink / raw)
  To: Sami Kerola; +Cc: util-linux, Rainer Gerhards

On Thu, Mar 05, 2015 at 09:12:00PM +0000, Sami Kerola wrote:
>  misc-utils/logger.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

 I already merged Rainer's version of the patch (it's almost the same,
 but it also set unix_socket path to _PATH_DEVLOG is no -u specified).

    Karel

-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-06 11:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-05 21:12 [PATCH] logger: make unix socket logging to use syslog_local format by default Sami Kerola
2015-03-06 11:56 ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox