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" "April 2013" "util-linux" "User Commands"
38 logger \- a shell command interface to the syslog(3) system log module
41 .RI [ options "] [" message ]
44 makes entries in the system log. It provides a shell command
50 \fB\-d\fR, \fB\-\-udp\fR
51 Use datagram (UDP) only. By default the connection is tried to the
53 port defined in /etc/services, which is often
56 \fB\-h\fR, \fB\-\-help\fR
57 Display help text and exit.
59 \fB\-i\fR, \fB\-\-id\fR
60 Log the process ID of the logger process with each line.
63 \fB\-n\fR, \fB\-\-server\fR \fIserver\fR
64 Write to the specified remote syslog
66 instead of to the builtin syslog routines. Unless
70 is specified, \fBlogger\fR will first try to use UDP,
71 but if thist fails a TCP connection is attempted.
73 \fB\-P\fR, \fB\-\-port\fR \fIport\fR
77 \fB\-f\fR, \fB\-\-file\fR \fIfile\fR
78 Log the contents of the specified
80 This option cannot be combined with a command-line message.
82 \fB\-p\fR, \fB\-\-priority\fR \fIpriority\fR
83 Enter the message into the log with the specified
85 The priority may be specified numerically or as a
91 logs the message as informational in the local3 facility.
95 \fB\-\-prio\-prefix\fR
96 Look for a syslog prefix on every line read from standard input.
97 This prefix is a number within angle brackets that contains both the facility
98 and the level. This decimal prefix is constructed by multiplying the
99 facility by 8 and then adding the level. Thus, for example, \fIlocal0.info\fR,
100 facility=16 and level=6, becomes \fI<134>\fR.
102 If the prefix contains no facility, the facility defaults to what is
103 specified by the \fB\-p\fR option. Similarly, if no prefix is provided,
104 the line is logged using the \fB\-p\fR \fIpriority\fR.
106 This option doesn't affect a command-line message.
108 \fB\-s\fR, \fB\-\-stderr\fR
109 Output the message to standard error as well as to the system log.
111 \fB\-T\fR, \fB\-\-tcp\fR
112 Use stream (TCP) only. By default the connection is tried to the
114 port defined in /etc/services, which is often
117 \fB\-t\fR, \fB\-\-tag\fR \fItag\fR
118 Mark every line to be logged with the specified
121 \fB\-u\fR, \fB\-\-socket\fR \fIsocket\fR
122 Write to the specified
124 instead of to the builtin syslog routines.
126 \fB\-\-journald\fR [\fIfile\fR]
127 Write systemd journal entry. The entry is read from
131 Each new line must begin with a field that is accepted by journald, see
132 .IR systemd.journal-fields (7)
133 for details. Use of MESSAGE_ID field is generally good idea, as they
134 make finding entries easy.
137 $ printf "%s\\n%s\\n%s\\n" MESSAGE_ID=86184c3b1aa444f58ebe7b30fec1438b DOGS=bark "CARAVAN=goes on" | logger --journald
138 $ logger --journald=entry.txt
143 will ignore values of other options, such as priority. If priority is
144 needed it must be within input, and use PRIORITY field. The simple
147 will display MESSAGE field. Use
148 .B journalctl --output json-pretty
149 to see rest of the fields.
151 \fB\-V\fR, \fB\-\-version\fR
152 Display version information and exit.
155 End the argument list. This is to allow the
157 to start with a hyphen (\-).
160 Write this \fImessage\fR to the log; if not specified, and the
162 flag is not provided, standard input is logged.
166 utility exits 0 on success, and >0 if an error occurs.
167 .SH FACILITIES AND LEVELS
168 Valid facility names are:
174 \fIauthpriv\fR:for security information of a sensitive nature
178 \fIkern\fR:cannot be generated from user process
188 \fIsecurity\fR:deprecated synonym for \fIauth\fR
191 Valid level names are:
204 \fIpanic\fR:deprecated synonym for \fIemerg\fR
205 \fIerror\fR:deprecated synonym for \fIerr\fR
206 \fIwarn\fR:deprecated synonym for \fIwarning\fR
209 For the priority order and intended purposes of these facilities and levels, see
212 logger System rebooted
214 logger \-p local0.notice \-t HOSTIDM \-f /dev/idmc
216 logger \-n loghost.example.com System rebooted
221 .BR systemd.journal-fields (7)
225 command is expected to be IEEE Std 1003.2 ("POSIX.2") compatible.
227 The logger command is part of the util-linux package and is available from
228 .UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/