diff options
author | Sami Kerola | 2014-02-21 20:25:30 +0100 |
---|---|---|
committer | Karel Zak | 2014-03-04 13:44:21 +0100 |
commit | 4b670c01dff7e5106d924a1267c23961b6926b6f (patch) | |
tree | 42d62bfb27695ee725571add9c5750d917bd6208 /misc-utils/logger.1 | |
parent | hexdump: color unit may now be longer than the corresponding format unit (diff) | |
download | kernel-qcow2-util-linux-4b670c01dff7e5106d924a1267c23961b6926b6f.tar.gz kernel-qcow2-util-linux-4b670c01dff7e5106d924a1267c23961b6926b6f.tar.xz kernel-qcow2-util-linux-4b670c01dff7e5106d924a1267c23961b6926b6f.zip |
logger: allow user to send structured journald messages
This feature is hopefully mostly used to give MESSAGE_ID labels for
messages coming from scripts, making search of messages easy. The
logger(1) manual page update should give enough information how to use
--journald option.
[kzak@redhat.com: - add missing #ifdefs
- use xalloc.h]
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/logger.1')
-rw-r--r-- | misc-utils/logger.1 | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/misc-utils/logger.1 b/misc-utils/logger.1 index c7c3de0f5..08cf907a6 100644 --- a/misc-utils/logger.1 +++ b/misc-utils/logger.1 @@ -122,6 +122,31 @@ Write to the specified .I socket instead of to the builtin syslog routines. .TP +\fB\-\-journald\fR [\fIfile\fR] +Write systemd journal entry. The entry is read from +.I stdin +or input +.IR file . +Each new line must begin with a field that is accepted by journald, see +.IR systemd.journal-fields (7) +for details. Use of MESSAGE_ID field is generally good idea, as they +make finding entries easy. +.IP +.nf +$ printf "%s\\n%s\\n%s\\n" MESSAGE_ID=86184c3b1aa444f58ebe7b30fec1438b DOGS=bark "CARAVAN=goes on" | logger --journald +$ logger --journald=entry.txt +.fi +.IP +Notice that +.B \-\-journald +will ignore values of other options, such as priority. If priority is +needed it must be within input, and use PRIORITY field. The simple +execution of +.B journalctl +will display MESSAGE field. Use +.B journalctl --output json-pretty +to see rest of the fields. +.TP \fB\-V\fR, \fB\-\-version\fR Display version information and exit. .TP @@ -169,7 +194,9 @@ logger \-p local0.notice \-t HOSTIDM \-f /dev/idmc logger \-n loghost.example.com System rebooted .SH SEE ALSO .BR syslog (3), -.BR syslogd (8) +.BR syslogd (8), +.BR journalctl (1), +.BR systemd.journal-fields (7) .SH STANDARDS The .B logger |