1 .\" Copyright (c) 1983, 1990, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)logger.1 8.1 (Berkeley) 6/6/93
34 .\" Section on valid facility and level strings added by
35 .\" and1000@debian.org, 26 Oct 1997.
36 .TH LOGGER "1" "June 2014" "util-linux" "User Commands"
38 logger \- a shell command interface to the syslog(3) system log module
45 makes entries in the system log. It provides a shell command
51 \fB\-d\fR, \fB\-\-udp\fR
52 Use datagram (UDP) only. By default the connection is tried to the
54 port defined in /etc/services, which is often
57 \fB\-h\fR, \fB\-\-help\fR
58 Display help text and exit.
60 \fB\-i\fR, \fB\-\-id\fR[=\fBid\fR]
61 Log the PID of the logger process with each line. When optional
64 is specified then it is used instead of logger command PID. Use of
66 (PPID) is recommended in scripts that send several messages.
68 \fB\-n\fR, \fB\-\-server\fR \fIserver\fR
69 Write to the specified remote syslog
71 instead of to the builtin syslog routines. Unless
75 is specified, \fBlogger\fR will first try to use UDP,
76 but if thist fails a TCP connection is attempted.
78 \fB\-P\fR, \fB\-\-port\fR \fIport\fR
83 is not specified it defaults to
89 \fB\-f\fR, \fB\-\-file\fR \fIfile\fR
90 Log the contents of the specified
92 This option cannot be combined with a command-line message.
94 \fB\-p\fR, \fB\-\-priority\fR \fIpriority\fR
95 Enter the message into the log with the specified
97 The priority may be specified numerically or as a
103 logs the message as informational in the local3 facility.
107 \fB\-\-prio\-prefix\fR
108 Look for a syslog prefix on every line read from standard input.
109 This prefix is a number within angle brackets that contains both the facility
110 and the level. This decimal prefix is constructed by multiplying the
111 facility by 8 and then adding the level. Thus, for example, \fIlocal0.info\fR,
112 facility=16 and level=6, becomes \fI<134>\fR.
114 If the prefix contains no facility, the facility defaults to what is
115 specified by the \fB\-p\fR option. Similarly, if no prefix is provided,
116 the line is logged using the \fB\-p\fR \fIpriority\fR.
118 This option doesn't affect a command-line message.
122 Use RFC 3164 BSD syslog protocol to submit messages to remote server.
124 \fB\-\-rfc5424\fR [\fInotime\fR,\fInotq\fR,\fInohost\fR]
125 Use RFC 5424 syslog protocol to submit messages to remote server.
128 will suppress submission of sender time stamp that is in ISO-8601 format,
129 including microseconds and timezone. When
131 is specified the time quality structured data, that can be suppressed
134 is excluded from output. The time quality information tells if local
135 clock was syncronized, and maximum number of microseconds the time stamp
136 could be off. Option argument
140 information from message header.
142 The rfc5424 protocol has been default for
146 \fB\-s\fR, \fB\-\-stderr\fR
147 Output the message to standard error as well as to the system log.
149 \fB\-T\fR, \fB\-\-tcp\fR
150 Use stream (TCP) only. By default the connection is tried to the
152 port defined in /etc/services, which is often
155 \fB\-t\fR, \fB\-\-tag\fR \fItag\fR
156 Mark every line to be logged with the specified
159 \fB\-u\fR, \fB\-\-socket\fR \fIsocket\fR
160 Write to the specified
162 instead of to the builtin syslog routines.
164 \fB\-\-journald\fR [\fIfile\fR]
165 Write systemd journal entry. The entry is read from
169 Each new line must begin with a field that is accepted by journald, see
170 .IR systemd.journal-fields (7)
171 for details. Use of MESSAGE_ID field is generally good idea, as they
172 make finding entries easy.
175 $ printf "%s\\n%s\\n%s\\n" MESSAGE_ID=86184c3b1aa444f58ebe7b30fec1438b DOGS=bark "CARAVAN=goes on" | logger --journald
176 $ logger --journald=entry.txt
181 will ignore values of other options, such as priority. If priority is
182 needed it must be within input, and use PRIORITY field. The simple
185 will display MESSAGE field. Use
186 .B journalctl --output json-pretty
187 to see rest of the fields.
189 \fB\-V\fR, \fB\-\-version\fR
190 Display version information and exit.
193 End the argument list. This is to allow the
195 to start with a hyphen (\-).
198 Write this \fImessage\fR to the log; if not specified, and the
200 flag is not provided, standard input is logged.
204 utility exits 0 on success, and >0 if an error occurs.
205 .SH FACILITIES AND LEVELS
206 Valid facility names are:
212 \fIauthpriv\fR:for security information of a sensitive nature
216 \fIkern\fR:cannot be generated from user process
226 \fIsecurity\fR:deprecated synonym for \fIauth\fR
229 Valid level names are:
242 \fIpanic\fR:deprecated synonym for \fIemerg\fR
243 \fIerror\fR:deprecated synonym for \fIerr\fR
244 \fIwarn\fR:deprecated synonym for \fIwarning\fR
247 For the priority order and intended purposes of these facilities and levels, see
250 logger System rebooted
252 logger \-p local0.notice \-t HOSTIDM \-f /dev/idmc
254 logger \-n loghost.example.com System rebooted
259 .BR systemd.journal-fields (7)
263 command is expected to be IEEE Std 1003.2 ("POSIX.2") compatible.
265 The logger command is part of the util-linux package and is available from
266 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/