2006-12-06 17:25:32 -06:00
|
|
|
.\" Copyright (c) 1983, 1990, 1993
|
|
|
|
.\" The Regents of the University of California. All rights reserved.
|
|
|
|
.\"
|
|
|
|
.\" Redistribution and use in source and binary forms, with or without
|
|
|
|
.\" modification, are permitted provided that the following conditions
|
|
|
|
.\" are met:
|
|
|
|
.\" 1. Redistributions of source code must retain the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer.
|
|
|
|
.\" 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
.\" notice, this list of conditions and the following disclaimer in the
|
|
|
|
.\" documentation and/or other materials provided with the distribution.
|
|
|
|
.\" 3. All advertising materials mentioning features or use of this software
|
|
|
|
.\" must display the following acknowledgement:
|
|
|
|
.\" This product includes software developed by the University of
|
|
|
|
.\" California, Berkeley and its contributors.
|
|
|
|
.\" 4. Neither the name of the University nor the names of its contributors
|
|
|
|
.\" may be used to endorse or promote products derived from this software
|
|
|
|
.\" without specific prior written permission.
|
|
|
|
.\"
|
|
|
|
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
|
|
|
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
.\" SUCH DAMAGE.
|
|
|
|
.\"
|
|
|
|
.\" @(#)logger.1 8.1 (Berkeley) 6/6/93
|
|
|
|
.\"
|
2015-11-08 04:54:10 -06:00
|
|
|
.TH LOGGER "1" "November 2015" "util-linux" "User Commands"
|
2011-09-17 15:09:37 -05:00
|
|
|
.SH NAME
|
2014-12-14 13:45:30 -06:00
|
|
|
logger \- enter messages into the system log
|
2011-09-17 15:09:37 -05:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.B logger
|
2014-12-14 13:45:29 -06:00
|
|
|
[options]
|
|
|
|
.RI [ message ]
|
2011-09-17 15:09:37 -05:00
|
|
|
.SH DESCRIPTION
|
|
|
|
.B logger
|
2015-03-06 04:48:23 -06:00
|
|
|
makes entries in the system log.
|
2014-12-14 13:45:30 -06:00
|
|
|
.sp
|
|
|
|
When the optional \fImessage\fR argument is present, it is written
|
|
|
|
to the log. If it is not present, and the \fB\-f\fR option is not
|
|
|
|
given either, then standard input is logged.
|
2011-09-17 15:09:37 -05:00
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
2014-12-14 13:45:30 -06:00
|
|
|
.BR \-d , " \-\-udp"
|
|
|
|
Use datagrams (UDP) only. By default the connection is tried to the
|
2020-07-24 05:06:14 -05:00
|
|
|
syslog port defined in
|
|
|
|
.IR /etc/services ,
|
|
|
|
which is often 514.
|
|
|
|
.IP
|
2019-01-29 08:44:13 -06:00
|
|
|
See also \fB\-\-server\fR and \fB\-\-socket\fR to specify where to connect.
|
2013-10-13 14:01:07 -05:00
|
|
|
.TP
|
2015-03-07 05:14:21 -06:00
|
|
|
.BR \-e , " \-\-skip-empty"
|
2015-11-08 04:54:10 -06:00
|
|
|
Ignore empty lines when processing files. An empty line
|
|
|
|
is defined to be a line without any characters. Thus a line consisting
|
2015-03-07 05:14:21 -06:00
|
|
|
only of whitespace is NOT considered empty.
|
2015-11-08 04:54:10 -06:00
|
|
|
Note that when the \fB\-\-prio\-prefix\fR option is specified, the priority
|
|
|
|
is not part of the line. Thus an empty line in this mode is a line that does
|
2019-12-14 16:42:47 -06:00
|
|
|
not have any characters after the priority prefix (e.g., \fB<13>\fR).
|
2015-03-07 05:14:21 -06:00
|
|
|
.TP
|
2014-12-14 13:45:30 -06:00
|
|
|
.BR \-f , " \-\-file " \fIfile
|
|
|
|
Log the contents of the specified \fIfile\fR.
|
|
|
|
This option cannot be combined with a command-line message.
|
2013-10-13 14:01:07 -05:00
|
|
|
.TP
|
2015-02-20 13:42:34 -06:00
|
|
|
.B \-i
|
|
|
|
Log the PID of the logger process with each line.
|
|
|
|
.TP
|
|
|
|
.BR "\-\-id" [ =\fIid ]
|
2014-12-14 13:45:30 -06:00
|
|
|
Log the PID of the logger process with each line. When the optional
|
|
|
|
argument \fIid\fR is specified, then it is used instead of the logger
|
|
|
|
command's PID. The use of \fB\-\-id=$$\fR
|
2014-08-20 05:24:40 -05:00
|
|
|
(PPID) is recommended in scripts that send several messages.
|
2015-10-29 05:18:21 -05:00
|
|
|
|
2015-11-08 04:54:10 -06:00
|
|
|
Note that the system logging infrastructure (for example \fBsystemd\fR when
|
2020-07-24 05:06:14 -05:00
|
|
|
listening on
|
|
|
|
.IR /dev/log )
|
|
|
|
may follow local socket credentials to overwrite the
|
2015-11-08 04:54:10 -06:00
|
|
|
PID specified in the message.
|
2016-05-10 14:26:54 -05:00
|
|
|
.BR logger (1)
|
2015-11-08 04:54:10 -06:00
|
|
|
is able to set those socket credentials to the given \fIid\fR, but only if you
|
|
|
|
have root permissions and a process with the specified PID exists, otherwise
|
2015-10-29 05:18:21 -05:00
|
|
|
the socket credentials are not modified and the problem is silently ignored.
|
2013-10-13 14:01:07 -05:00
|
|
|
.TP
|
2014-12-14 13:45:30 -06:00
|
|
|
.BR \-\-journald [ =\fIfile ]
|
|
|
|
Write a systemd journal entry. The entry is read from the given \fIfile\fR,
|
|
|
|
when specified, otherwise from standard input.
|
|
|
|
Each line must begin with a field that is accepted by journald; see
|
|
|
|
.BR systemd.journal-fields (7)
|
|
|
|
for details. The use of a MESSAGE_ID field is generally a good idea, as it
|
|
|
|
makes finding entries easy. Examples:
|
|
|
|
.IP
|
|
|
|
.nf
|
2016-03-10 07:33:45 -06:00
|
|
|
\fB logger \-\-journald <<end
|
2015-09-03 06:41:19 -05:00
|
|
|
\fB MESSAGE_ID=67feb6ffbaf24c5cbec13c008dd72309
|
|
|
|
\fB MESSAGE=The dogs bark, but the caravan goes on.
|
|
|
|
\fB DOGS=bark
|
|
|
|
\fB CARAVAN=goes on
|
|
|
|
\fB end
|
|
|
|
.IP
|
2016-03-10 07:33:45 -06:00
|
|
|
\fB logger \-\-journald=entry.txt
|
2014-12-14 13:45:30 -06:00
|
|
|
.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
|
2016-03-10 07:33:45 -06:00
|
|
|
.B journalctl \-\-output json-pretty
|
2014-12-14 13:45:30 -06:00
|
|
|
to see rest of the fields.
|
2019-01-23 04:41:43 -06:00
|
|
|
.sp
|
|
|
|
To include newlines in MESSAGE, specify MESSAGE several times. This is
|
|
|
|
handled as a special case, other fields will be stored as an array in
|
|
|
|
the journal if they appear multiple times.
|
2015-03-10 11:47:30 -05:00
|
|
|
.TP
|
2020-06-10 18:57:22 -05:00
|
|
|
.BI \-\-msgid " msgid"
|
2015-11-08 04:54:10 -06:00
|
|
|
Sets the RFC5424 MSGID field. Note that the space character is not permitted
|
|
|
|
inside of \fImsgid\fR. This option is only used if \fB\-\-rfc5424\fR is
|
|
|
|
specified as well; otherwise, it is silently ignored.
|
2014-12-14 13:45:30 -06:00
|
|
|
.TP
|
|
|
|
.BR \-n , " \-\-server " \fIserver
|
|
|
|
Write to the specified remote syslog \fIserver\fR
|
2015-03-06 05:30:56 -06:00
|
|
|
instead of to the system log socket. Unless
|
2014-12-14 13:45:30 -06:00
|
|
|
\fB\-\-udp\fR or \fB\-\-tcp\fR
|
2013-10-13 05:54:58 -05:00
|
|
|
is specified, \fBlogger\fR will first try to use UDP,
|
2016-05-29 15:54:03 -05:00
|
|
|
but if this fails a TCP connection is attempted.
|
2013-04-05 15:17:24 -05:00
|
|
|
.TP
|
2018-05-18 14:21:42 -05:00
|
|
|
.B \-\-no\-act
|
2015-11-08 04:54:11 -06:00
|
|
|
Causes everything to be done except for writing the log message to the system
|
|
|
|
log, and removing the connection or the journal. This option can be used
|
|
|
|
together with \fB\-\-stderr\fR for testing purposes.
|
|
|
|
.TP
|
|
|
|
.B \-\-octet\-count
|
|
|
|
Use the RFC 6587 octet counting framing method for sending messages.
|
|
|
|
When this option is not used, the default is no framing on UDP, and
|
|
|
|
RFC6587 non-transparent framing (also known as octet stuffing) on TCP.
|
|
|
|
.TP
|
2014-12-14 13:45:30 -06:00
|
|
|
.BR \-P , " \-\-port " \fIport
|
|
|
|
Use the specified \fIport\fR. When this option is not specified, the
|
|
|
|
port defaults to syslog for udp and to syslog-conn for tcp connections.
|
2011-09-17 15:09:37 -05:00
|
|
|
.TP
|
2014-12-14 13:45:30 -06:00
|
|
|
.BR \-p , " \-\-priority " \fIpriority
|
|
|
|
Enter the message into the log with the specified \fIpriority\fR.
|
2011-09-17 15:09:37 -05:00
|
|
|
The priority may be specified numerically or as a
|
2014-12-14 13:45:30 -06:00
|
|
|
.IR facility . level
|
2006-12-06 17:25:32 -06:00
|
|
|
pair.
|
2014-12-14 13:45:30 -06:00
|
|
|
For example, \fB\-p local3.info\fR
|
2011-09-17 15:09:37 -05:00
|
|
|
logs the message as informational in the local3 facility.
|
2014-12-14 13:45:30 -06:00
|
|
|
The default is \fBuser.notice\fR.
|
2011-09-17 15:09:37 -05:00
|
|
|
.TP
|
2015-01-19 19:11:52 -06:00
|
|
|
.B \-\-prio\-prefix
|
2013-10-13 05:54:58 -05:00
|
|
|
Look for a syslog prefix on every line read from standard input.
|
2014-12-14 13:45:30 -06:00
|
|
|
This prefix is a decimal number within angle brackets that encodes both
|
|
|
|
the facility and the level. The number is constructed by multiplying the
|
|
|
|
facility by 8 and then adding the level. For example, \fBlocal0.info\fR,
|
|
|
|
meaning facility=16 and level=6, becomes \fB<134>\fR.
|
|
|
|
.sp
|
2013-05-22 06:12:08 -05:00
|
|
|
If the prefix contains no facility, the facility defaults to what is
|
2013-10-13 05:54:58 -05:00
|
|
|
specified by the \fB\-p\fR option. Similarly, if no prefix is provided,
|
2014-12-14 13:45:30 -06:00
|
|
|
the line is logged using the \fIpriority\fR given with \fB\-p\fR.
|
|
|
|
.sp
|
2013-05-22 06:12:08 -05:00
|
|
|
This option doesn't affect a command-line message.
|
2014-06-28 09:37:39 -05:00
|
|
|
.TP
|
2014-12-14 13:45:30 -06:00
|
|
|
.B \-\-rfc3164
|
|
|
|
Use the RFC 3164 BSD syslog protocol to submit messages to a remote server.
|
|
|
|
.TP
|
|
|
|
.BR \-\-rfc5424 [ =\fIwithout ]
|
|
|
|
Use the RFC 5424 syslog protocol to submit messages to a remote server.
|
|
|
|
The optional \fIwithout\fR argument can be a comma-separated list of
|
|
|
|
the following values: \fBnotq\fR, \fBnotime\fR, \fBnohost\fR.
|
2015-10-01 07:48:15 -05:00
|
|
|
|
2014-12-14 13:45:30 -06:00
|
|
|
The \fBnotq\fR value suppresses the time-quality structured data
|
2015-10-01 07:48:15 -05:00
|
|
|
from the submitted message. The time-quality information shows whether
|
2015-01-18 14:40:30 -06:00
|
|
|
the local clock was synchronized plus the maximum number of microseconds
|
2015-11-08 04:54:10 -06:00
|
|
|
the timestamp might be off. The time quality is also automatically
|
|
|
|
suppressed when \fB\-\-sd\-id timeQuality\fR is specified.
|
2015-10-01 07:48:15 -05:00
|
|
|
|
2015-11-08 04:54:10 -06:00
|
|
|
The \fBnotime\fR value (which implies \fBnotq\fR)
|
|
|
|
suppresses the complete sender timestamp that is in
|
2014-12-14 13:45:30 -06:00
|
|
|
ISO-8601 format, including microseconds and timezone.
|
2015-10-01 07:48:15 -05:00
|
|
|
|
2014-12-14 13:45:30 -06:00
|
|
|
The \fBnohost\fR value suppresses
|
|
|
|
.BR gethostname (2)
|
|
|
|
information from the message header.
|
2014-06-28 09:37:39 -05:00
|
|
|
.IP
|
2015-01-18 14:40:30 -06:00
|
|
|
The RFC 5424 protocol has been the default for
|
2014-06-28 09:37:39 -05:00
|
|
|
.B logger
|
|
|
|
since version 2.26.
|
2013-05-22 06:12:08 -05:00
|
|
|
.TP
|
2015-11-08 04:54:11 -06:00
|
|
|
.BR \-s , " \-\-stderr"
|
|
|
|
Output the message to standard error as well as to the system log.
|
|
|
|
.TP
|
2015-11-08 04:54:10 -06:00
|
|
|
.BR "\-\-sd\-id \fIname" [ @\fIdigits ]
|
|
|
|
Specifies a structured data element ID for an RFC 5424 message header. The
|
|
|
|
option has to be used before \fB\-\-sd\-param\fR to introduce a new element.
|
|
|
|
The number of structured data elements is unlimited. The ID (\fIname\fR plus
|
|
|
|
possibly \fB@\fIdigits\fR) is case-sensitive and uniquely identifies the type
|
|
|
|
and purpose of the element. The same ID must not exist more than once in
|
|
|
|
a message. The \fB@\fIdigits\fR part is required for user-defined
|
|
|
|
non-standardized IDs.
|
2015-10-01 07:48:15 -05:00
|
|
|
|
2015-11-08 04:54:10 -06:00
|
|
|
\fBlogger\fR currently generates the \fBtimeQuality\fR standardized element
|
|
|
|
only. RFC 5424 also describes the elements \fBorigin\fR (with parameters
|
|
|
|
ip, enterpriseId, software and swVersion) and \fBmeta\fR (with parameters
|
|
|
|
sequenceId, sysUpTime and language).
|
|
|
|
These element IDs may be specified without the \fB@\fIdigits\fR suffix.
|
2015-10-01 07:48:15 -05:00
|
|
|
|
|
|
|
.TP
|
2015-11-08 04:54:10 -06:00
|
|
|
.BR "\-\-sd\-param " \fIname ="\fIvalue\fB"
|
2016-05-29 15:54:03 -05:00
|
|
|
Specifies a structured data element parameter, a name and value pair.
|
2015-11-08 04:54:10 -06:00
|
|
|
The option has to be used after \fB\-\-sd\-id\fR and may be specified more
|
|
|
|
than once for the same element. Note that the quotation marks around
|
|
|
|
\fIvalue\fR are required and must be escaped on the command line.
|
2015-10-01 07:48:15 -05:00
|
|
|
.IP
|
|
|
|
.nf
|
2016-03-10 07:33:45 -06:00
|
|
|
\fB logger \-\-rfc5424 \-\-sd-id zoo@123 \\
|
|
|
|
\fB \-\-sd-param tiger=\\"hungry\\" \\
|
|
|
|
\fB \-\-sd-param zebra=\\"running\\" \\
|
|
|
|
\fB \-\-sd-id manager@123 \\
|
|
|
|
\fB \-\-sd-param onMeeting=\\"yes\\" \\
|
2015-10-01 07:48:15 -05:00
|
|
|
\fB "this is message"
|
|
|
|
.fi
|
|
|
|
.IP
|
|
|
|
produces:
|
|
|
|
.IP
|
2020-06-10 18:57:22 -05:00
|
|
|
.\".nf
|
|
|
|
.\" this long line gets cut of in the output of "troff", and wraps
|
|
|
|
.\" in "nroff"
|
2015-10-01 07:48:15 -05:00
|
|
|
\fB <13>1 2015-10-01T14:07:59.168662+02:00 ws kzak - - [timeQuality tzKnown="1" isSynced="1" syncAccuracy="218616"][zoo@123 tiger="hungry" zebra="running"][manager@123 onMeeting="yes"] this is message
|
2020-06-10 18:57:22 -05:00
|
|
|
.\".fi
|
2015-10-01 07:48:15 -05:00
|
|
|
.TP
|
2020-06-10 18:57:22 -05:00
|
|
|
.BR \-S , " \-\-size " \fIsize
|
2015-11-08 04:54:11 -06:00
|
|
|
Sets the maximum permitted message size to \fIsize\fR. The default
|
|
|
|
is 1KiB characters, which is the limit traditionally used and specified
|
|
|
|
in RFC 3164. With RFC 5424, this limit has become flexible. A good assumption
|
|
|
|
is that RFC 5424 receivers can at least process 4KiB messages.
|
|
|
|
|
|
|
|
Most receivers accept messages larger than 1KiB over any type of syslog
|
|
|
|
protocol. As such, the \fB\-\-size\fR option affects logger in
|
|
|
|
all cases (not only when \fB\-\-rfc5424\fR was used).
|
|
|
|
|
|
|
|
Note: the message-size limit limits the overall message size, including
|
|
|
|
the syslog header. Header sizes vary depending on the selected options and
|
|
|
|
the hostname length. As a rule of thumb, headers are usually not longer than
|
|
|
|
50 to 80 characters. When selecting a maximum message size, it is important
|
|
|
|
to ensure that the receiver supports the max size as well, otherwise messages
|
|
|
|
may become truncated. Again, as a rule of thumb two to four KiB message size
|
|
|
|
should generally be OK, whereas anything larger should be verified to work.
|
|
|
|
|
2013-10-13 14:01:07 -05:00
|
|
|
.TP
|
logger: add --socket-errors compatibility option
Hello,
Depending viewpoint this change is either regression fix, or
re-regression in context of none-systemd init. I ack the change is sent
very late to be part of v2.26, but then again the excess noise was found
only because of -rc1 was tested in sysvinit environment. IMHO it would
contradict purpose of having rc's if faults will not lead to fixes.
I also want to point out the sysvinit scripts are broken, not the
logger(1), but getting them corrected is practically impossible.
Assuming sysvinit script are further developed by various teams and
distributions who maintain them they should use --socket-error=on in
future, and write scripts that pass without noise. Meanwhile trying to
be clever when to silence errors seems like a reasonable thing to do.
--->8----
From: Sami Kerola <kerolasa@iki.fi>
Date: Sat, 14 Feb 2015 19:05:55 +0000
Subject: [PATCH] logger: add --socket-errors compatibility option
Now when logger(1) has stopped using openlog() for Unix sockets, in
commit mentioned in reference, the lack of /dev/log detected will report
error accordingly. According to Gabriele Balducci this makes sysvinit
style boot scripts to print a lot of errors. So make the logger to
detect whether it should be in compatibility mode, and not report errors
if logging device is missing. That imitates behavior of glibc openlog().
To allow full control to users the /dev/log error messages can be forced
to on or off. The automatic error messaging is explained in manual page.
Reference: 1d57503378bdcd838365d625f6d2d0a09da9c29d
Reported-by: Gabriele Balducci <balducci@units.it>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-15 03:50:23 -06:00
|
|
|
.BR \-\-socket\-errors [ =\fImode ]
|
|
|
|
Print errors about Unix socket connections. The \fImode\fR can be a value of
|
|
|
|
\fBoff\fR, \fBon\fR, or \fBauto\fR. When the mode is auto logger will detect
|
|
|
|
if the init process is systemd, and if so assumption is made /dev/log can be
|
|
|
|
used early at boot. Other init systems lack of /dev/log will not cause errors
|
|
|
|
that is identical with messaging using
|
|
|
|
.BR openlog (3)
|
|
|
|
system call. The
|
|
|
|
.BR logger (1)
|
2016-05-29 15:54:03 -05:00
|
|
|
before version 2.26 used openlog, and hence was unable to detected loss of
|
logger: add --socket-errors compatibility option
Hello,
Depending viewpoint this change is either regression fix, or
re-regression in context of none-systemd init. I ack the change is sent
very late to be part of v2.26, but then again the excess noise was found
only because of -rc1 was tested in sysvinit environment. IMHO it would
contradict purpose of having rc's if faults will not lead to fixes.
I also want to point out the sysvinit scripts are broken, not the
logger(1), but getting them corrected is practically impossible.
Assuming sysvinit script are further developed by various teams and
distributions who maintain them they should use --socket-error=on in
future, and write scripts that pass without noise. Meanwhile trying to
be clever when to silence errors seems like a reasonable thing to do.
--->8----
From: Sami Kerola <kerolasa@iki.fi>
Date: Sat, 14 Feb 2015 19:05:55 +0000
Subject: [PATCH] logger: add --socket-errors compatibility option
Now when logger(1) has stopped using openlog() for Unix sockets, in
commit mentioned in reference, the lack of /dev/log detected will report
error accordingly. According to Gabriele Balducci this makes sysvinit
style boot scripts to print a lot of errors. So make the logger to
detect whether it should be in compatibility mode, and not report errors
if logging device is missing. That imitates behavior of glibc openlog().
To allow full control to users the /dev/log error messages can be forced
to on or off. The automatic error messaging is explained in manual page.
Reference: 1d57503378bdcd838365d625f6d2d0a09da9c29d
Reported-by: Gabriele Balducci <balducci@units.it>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-15 03:50:23 -06:00
|
|
|
messages sent to Unix sockets.
|
|
|
|
.IP
|
|
|
|
The default mode is \fBauto\fR. When errors are not enabled lost messages are
|
2020-05-19 07:54:07 -05:00
|
|
|
not communicated and will result to successful exit status of
|
logger: add --socket-errors compatibility option
Hello,
Depending viewpoint this change is either regression fix, or
re-regression in context of none-systemd init. I ack the change is sent
very late to be part of v2.26, but then again the excess noise was found
only because of -rc1 was tested in sysvinit environment. IMHO it would
contradict purpose of having rc's if faults will not lead to fixes.
I also want to point out the sysvinit scripts are broken, not the
logger(1), but getting them corrected is practically impossible.
Assuming sysvinit script are further developed by various teams and
distributions who maintain them they should use --socket-error=on in
future, and write scripts that pass without noise. Meanwhile trying to
be clever when to silence errors seems like a reasonable thing to do.
--->8----
From: Sami Kerola <kerolasa@iki.fi>
Date: Sat, 14 Feb 2015 19:05:55 +0000
Subject: [PATCH] logger: add --socket-errors compatibility option
Now when logger(1) has stopped using openlog() for Unix sockets, in
commit mentioned in reference, the lack of /dev/log detected will report
error accordingly. According to Gabriele Balducci this makes sysvinit
style boot scripts to print a lot of errors. So make the logger to
detect whether it should be in compatibility mode, and not report errors
if logging device is missing. That imitates behavior of glibc openlog().
To allow full control to users the /dev/log error messages can be forced
to on or off. The automatic error messaging is explained in manual page.
Reference: 1d57503378bdcd838365d625f6d2d0a09da9c29d
Reported-by: Gabriele Balducci <balducci@units.it>
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2015-02-15 03:50:23 -06:00
|
|
|
.BR logger (1)
|
|
|
|
invocation.
|
|
|
|
.TP
|
2015-11-08 04:54:11 -06:00
|
|
|
.BR \-T , " \-\-tcp"
|
|
|
|
Use stream (TCP) only. By default the connection is tried to the
|
|
|
|
.I syslog-conn
|
|
|
|
port defined in /etc/services, which is often
|
|
|
|
.IR 601 .
|
2019-01-29 08:44:13 -06:00
|
|
|
.sp
|
|
|
|
See also \fB\-\-server\fR and \fB\-\-socket\fR to specify where to connect.
|
2015-11-08 04:54:11 -06:00
|
|
|
.TP
|
|
|
|
.BR \-t , " \-\-tag " \fItag
|
|
|
|
Mark every line to be logged with the specified
|
|
|
|
.IR tag .
|
2016-05-16 08:05:28 -05:00
|
|
|
The default tag is the name of the user logged in on the terminal (or a user
|
|
|
|
name based on effective user ID).
|
2015-11-08 04:54:11 -06:00
|
|
|
.TP
|
|
|
|
.BR \-u , " \-\-socket " \fIsocket
|
|
|
|
Write to the specified
|
|
|
|
.I socket
|
|
|
|
instead of to the system log socket.
|
|
|
|
.TP
|
2014-12-14 13:45:30 -06:00
|
|
|
.B \-\-
|
|
|
|
End the argument list. This allows the \fImessage\fR
|
|
|
|
to start with a hyphen (\-).
|
2014-02-21 13:25:30 -06:00
|
|
|
.TP
|
2014-12-14 13:45:30 -06:00
|
|
|
.BR \-V , " \-\-version"
|
2011-08-15 07:25:44 -05:00
|
|
|
Display version information and exit.
|
2011-09-17 15:09:37 -05:00
|
|
|
.TP
|
2014-12-14 13:45:30 -06:00
|
|
|
.BR \-h , " \-\-help"
|
|
|
|
Display help text and exit.
|
2020-05-19 07:53:21 -05:00
|
|
|
.SH EXIT STATUS
|
2006-12-06 17:25:32 -06:00
|
|
|
The
|
2011-09-17 15:09:37 -05:00
|
|
|
.B logger
|
2006-12-06 17:25:32 -06:00
|
|
|
utility exits 0 on success, and >0 if an error occurs.
|
2014-06-23 15:26:02 -05:00
|
|
|
.SH FACILITIES AND LEVELS
|
2011-09-17 15:09:37 -05:00
|
|
|
Valid facility names are:
|
2014-06-23 15:26:02 -05:00
|
|
|
.IP
|
2018-08-05 13:51:25 -05:00
|
|
|
.nr WI \n(.lu-\n(.iu-\w'\fBauthpriv\fR'u-3n
|
2014-06-23 15:26:02 -05:00
|
|
|
.TS
|
|
|
|
tab(:);
|
2018-08-05 13:51:25 -05:00
|
|
|
l lw(\n(WIu).
|
2014-12-14 13:45:30 -06:00
|
|
|
\fBauth
|
|
|
|
\fBauthpriv\fR:for security information of a sensitive nature
|
|
|
|
\fBcron
|
|
|
|
\fBdaemon
|
|
|
|
\fBftp
|
2018-08-05 13:51:25 -05:00
|
|
|
\fBkern\fR:T{
|
|
|
|
cannot be generated from userspace process, automatically converted to \fBuser
|
|
|
|
T}
|
2014-12-14 13:45:30 -06:00
|
|
|
\fBlpr
|
|
|
|
\fBmail
|
|
|
|
\fBnews
|
|
|
|
\fBsyslog
|
|
|
|
\fBuser
|
|
|
|
\fBuucp
|
|
|
|
\fBlocal0
|
2014-06-23 15:26:02 -05:00
|
|
|
to:
|
2014-12-14 13:45:30 -06:00
|
|
|
\fBlocal7
|
|
|
|
\fBsecurity\fR:deprecated synonym for \fBauth
|
2014-06-23 15:26:02 -05:00
|
|
|
.TE
|
2011-09-17 15:09:37 -05:00
|
|
|
.PP
|
2011-08-15 07:25:44 -05:00
|
|
|
Valid level names are:
|
2014-06-23 15:26:02 -05:00
|
|
|
.IP
|
|
|
|
.TS
|
|
|
|
tab(:);
|
2018-08-03 16:12:04 -05:00
|
|
|
l l.
|
2014-12-14 13:45:30 -06:00
|
|
|
\fBemerg
|
|
|
|
\fBalert
|
|
|
|
\fBcrit
|
|
|
|
\fBerr
|
|
|
|
\fBwarning
|
|
|
|
\fBnotice
|
|
|
|
\fBinfo
|
|
|
|
\fBdebug
|
|
|
|
\fBpanic\fR:deprecated synonym for \fBemerg
|
|
|
|
\fBerror\fR:deprecated synonym for \fBerr
|
|
|
|
\fBwarn\fR:deprecated synonym for \fBwarning
|
2014-06-23 15:26:02 -05:00
|
|
|
.TE
|
|
|
|
.PP
|
|
|
|
For the priority order and intended purposes of these facilities and levels, see
|
2011-09-17 15:09:37 -05:00
|
|
|
.BR syslog (3).
|
Manual pages: order NOTES / HISTORY / BUGS / EXAMPLE consistently
There is value in ensuring that manual page sections use consistently
named sections, as far as possible, and also that sections have a
consistent order within manual pages. This is one of a series of patches
to place manual page sections in a consistent order.
In this patch, we ensure that the NOTES, HISTORY, BUGS, and EXAMPLE
sections are always placed near the end of the page, just above
AUTHORS, COPYRIGHT, SEE ALSO, and AVAILABILITY.
One page is not fixed by this patch: term-utils/agetty.8. This page
is a mess of unusual section names, and probably requires an individual
edit.
Testing that no gross editing mistake (causing accidental loss or addition
of text) was performed as follows:
$ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > a
[Apply patch]
$ cat $(grep '\.SH' -l $(find . -name '*.[1-9]') |sort) | sort > b
$ diff a b
$ echo $?
0
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-05-21 02:28:32 -05:00
|
|
|
.SH CONFORMING TO
|
|
|
|
The
|
|
|
|
.B logger
|
|
|
|
command is expected to be IEEE Std 1003.2 ("POSIX.2") compatible.
|
2020-05-25 07:59:12 -05:00
|
|
|
.SH EXAMPLES
|
2014-12-14 13:45:30 -06:00
|
|
|
.B logger System rebooted
|
2011-09-17 15:09:37 -05:00
|
|
|
.br
|
2014-12-14 13:45:30 -06:00
|
|
|
.B logger \-p local0.notice \-t HOSTIDM \-f /dev/idmc
|
2011-09-17 15:09:37 -05:00
|
|
|
.br
|
2014-12-14 13:45:30 -06:00
|
|
|
.B logger \-n loghost.example.com System rebooted
|
2019-01-29 08:59:41 -06:00
|
|
|
.SH AUTHORS
|
|
|
|
The
|
|
|
|
.B logger
|
|
|
|
command
|
|
|
|
was originally written by University of California in 1983-1993 and later
|
|
|
|
rewritten by
|
|
|
|
.MT kzak@redhat.com
|
|
|
|
Karel Zak
|
|
|
|
.ME ,
|
|
|
|
.MT rgerhards@adiscon.com
|
|
|
|
Rainer Gerhards
|
|
|
|
.ME
|
|
|
|
and
|
|
|
|
.MT kerolasa@iki.fi
|
|
|
|
Sami Kerola
|
|
|
|
.ME .
|
2020-05-21 02:28:21 -05:00
|
|
|
.SH SEE ALSO
|
|
|
|
.BR journalctl (1),
|
|
|
|
.BR syslog (3),
|
|
|
|
.BR systemd.journal-fields (7)
|
2011-09-17 15:09:37 -05:00
|
|
|
.SH AVAILABILITY
|
2010-11-30 04:41:59 -06:00
|
|
|
The logger command is part of the util-linux package and is available from
|
2016-12-17 02:06:57 -06:00
|
|
|
.UR https://\:www.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
|
2011-09-17 15:09:37 -05:00
|
|
|
Linux Kernel Archive
|
|
|
|
.UE .
|