summaryrefslogtreecommitdiffstats
path: root/misc-utils/logger.1
diff options
context:
space:
mode:
authorDennis H Jensen2013-05-22 13:12:08 +0200
committerKarel Zak2013-05-29 10:47:16 +0200
commit98920f80591b61ffdf7bfd99e2dd824406276e78 (patch)
treef3b95b960f74d4aa6d596ae4ef7d987f2ca9fa15 /misc-utils/logger.1
parentcal: improve coding style (diff)
downloadkernel-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.113
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