diff options
author | Dennis H Jensen | 2013-05-22 13:12:08 +0200 |
---|---|---|
committer | Karel Zak | 2013-05-29 10:47:16 +0200 |
commit | 98920f80591b61ffdf7bfd99e2dd824406276e78 (patch) | |
tree | f3b95b960f74d4aa6d596ae4ef7d987f2ca9fa15 /misc-utils/logger.1 | |
parent | cal: improve coding style (diff) | |
download | kernel-qcow2-util-linux-98920f80591b61ffdf7bfd99e2dd824406276e78.tar.gz kernel-qcow2-util-linux-98920f80591b61ffdf7bfd99e2dd824406276e78.tar.xz kernel-qcow2-util-linux-98920f80591b61ffdf7bfd99e2dd824406276e78.zip |
logger: add support for --prio-prefix when logging stdin
This patch adds a new option to logger that will make it look for a
priority prefix <n> at the beginning of every line. The priority is
a single decimal number formed as explained in syslog(3).
If a prefix is found logger will log the message using the found
facility and level in that prefix, if the prefix doesn't contain a
facility the default facility specified by the -p option will be used.
If no prefix is found, logger will use the priority specified by -p.
[kzak@redhat.com: - add --prio-prefix to usage() output]
Signed-off-by: Dennis H Jensen <dennis.h.jensen@siemens.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'misc-utils/logger.1')
-rw-r--r-- | misc-utils/logger.1 | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/misc-utils/logger.1 b/misc-utils/logger.1 index 09ecdc4f8..f4cadc697 100644 --- a/misc-utils/logger.1 +++ b/misc-utils/logger.1 @@ -109,6 +109,19 @@ Write to the specified .I socket instead of to the builtin syslog routines. .TP +\fB\-\-prio\-prefix\fR +Look for a syslog prefix on every line read from standard input, a +number contained within angle brackets that contain both the facility +and level. The decimal prefix is constructed by multiplying the +facility by 8 and then adding the level, thus \fIlocal0.info\fR, +facility=16 and level=6, becomes \fI<134>\fR. + +If the prefix contains no facility, the facility defaults to what is +specified by \fB\-p\fR option, similarly if no prefix is provided the +line is logged using the \fB\-p\fR \fIpriority\fR. + +This option doesn't affect a command-line message. +.TP \fB\-V\fR, \fB\-\-version\fR Display version information and exit. .TP |