Util-Linux package development
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: Sami Kerola <kerolasa@iki.fi>, Rainer Gerhards <rgerhards@adiscon.com>
Subject: [PATCH] logger: make unix socket logging to use syslog_local format by default
Date: Thu,  5 Mar 2015 21:12:00 +0000	[thread overview]
Message-ID: <1425589920-850-1-git-send-email-kerolasa@iki.fi> (raw)

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


             reply	other threads:[~2015-03-05 21:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-05 21:12 Sami Kerola [this message]
2015-03-06 11:56 ` [PATCH] logger: make unix socket logging to use syslog_local format by default Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1425589920-850-1-git-send-email-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=rgerhards@adiscon.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox