All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] logger man page: improve logger --journald example
@ 2015-09-03 11:41 Michal Schmidt
  2015-09-07  6:54 ` Karel Zak
  0 siblings, 1 reply; 2+ messages in thread
From: Michal Schmidt @ 2015-09-03 11:41 UTC (permalink / raw)
  To: util-linux

The example use of logger --journald in the man page has a couple of flaws:
 - It's missing a "MESSAGE=" field. This is supposed to be the primary
   human readable text. Without it the log entry is invisible in a
   plain "journalctl" output.
 - The MESSAGE_ID is supposed to be a 128-bit hexadecimal string that
   globally uniquely identifies the message type.
   One can generate such an id with "journalctl --new-id".

This patches fixes the above and also changes the example to use a
here-document instead of printf. In my opinion it makes the expected
multi-line data format more obvious.

Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
---
 misc-utils/logger.1 | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/misc-utils/logger.1 b/misc-utils/logger.1
index 36c923d52c..5deb3f0a1f 100644
--- a/misc-utils/logger.1
+++ b/misc-utils/logger.1
@@ -81,7 +81,13 @@ for details.  The use of a MESSAGE_ID field is generally a good idea, as it
 makes finding entries easy.  Examples:
 .IP
 .nf
-\fB    printf \(dq%s\\n%s\\n%s\\n\(dq MESSAGE_ID=42 DOGS=bark \(dqCARAVAN=goes on\(dq | logger --journald
+\fB    logger --journald <<end
+\fB    MESSAGE_ID=67feb6ffbaf24c5cbec13c008dd72309
+\fB    MESSAGE=The dogs bark, but the caravan goes on.
+\fB    DOGS=bark
+\fB    CARAVAN=goes on
+\fB    end
+.IP
 \fB    logger --journald=entry.txt
 .fi
 .IP
-- 
2.4.3


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

* Re: [PATCH] logger man page: improve logger --journald example
  2015-09-03 11:41 [PATCH] logger man page: improve logger --journald example Michal Schmidt
@ 2015-09-07  6:54 ` Karel Zak
  0 siblings, 0 replies; 2+ messages in thread
From: Karel Zak @ 2015-09-07  6:54 UTC (permalink / raw)
  To: Michal Schmidt; +Cc: util-linux

On Thu, Sep 03, 2015 at 01:41:19PM +0200, Michal Schmidt wrote:
>  misc-utils/logger.1 | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)

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

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

end of thread, other threads:[~2015-09-07  6:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-03 11:41 [PATCH] logger man page: improve logger --journald example Michal Schmidt
2015-09-07  6:54 ` Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.