1LOGGER(1) User Commands LOGGER(1)
2
3
4
6 logger - a shell command interface to the syslog(3) system log module
7
9 logger [options] [message]
10
12 logger makes entries in the system log. It provides a shell command
13 interface to the syslog(3) system log module.
14
16 -n, --server server
17 Write to the specified remote syslog server instead of to the
18 builtin syslog routines. Unless --udp or --tcp is specified the
19 logger will first try to use UDP, but if it fails a TCP connec‐
20 tion is attempted.
21
22 -d, --udp
23 Use datagram (UDP) only. By default the connection is tried to
24 syslog port defined in /etc/services, which is often 514.
25
26 -T, --tcp
27 Use stream (TCP) only. By default the connection is tried to
28 syslog-conn port defined in /etc/services, which is often 601.
29
30 -P, --port port
31 Use the specified port. When this option is not specified, the
32 port defaults to syslog for udp and to syslog-conn for tcp con‐
33 nections.
34
35 -i, --id
36 Log the process ID of the logger process with each line.
37
38 -f, --file file
39 Log the contents of the specified file. This option cannot be
40 combined with a command-line message.
41
42 -h, --help
43 Display a help text and exit.
44
45 -p, --priority priority
46 Enter the message into the log with the specified priority. The
47 priority may be specified numerically or as a facility.level
48 pair. For example, -p local3.info logs the message as informa‐
49 tional in the local3 facility. The default is user.notice.
50
51 -S, --size size
52 Sets the maximum permitted message size. The default is 1KiB,
53 which is the limit traditionally used and specified in RFC 3164.
54 When selecting a maximum message size, it is important to ensure
55 that the receiver supports the max size as well, otherwise mes‐
56 sages may become truncated.
57
58 -s, --stderr
59 Output the message to standard error as well as to the system
60 log.
61
62 -t, --tag tag
63 Mark every line to be logged with the specified tag. The
64 default tag is the name of the user logged in on the terminal
65 (or a user name based on effective user ID).
66
67 -u, --socket socket
68 Write to the specified socket instead of to the builtin syslog
69 routines.
70
71 -V, --version
72 Display version information and exit.
73
74 -- End the argument list. This is to allow the message to start
75 with a hyphen (-).
76
77 message
78 Write the message to log; if not specified, and the -f flag is
79 not provided, standard input is logged.
80
81 The logger utility exits 0 on success, and >0 if an error occurs.
82
84 Valid facility names are:
85
86 auth
87 authpriv for security information of a sensitive nature
88 cron
89 daemon
90 ftp
91 kern cannot be generated from userspace process, automatically converted to user
92 lpr
93 mail
94 news
95 syslog
96 user
97 uucp
98 local0
99 to
100 local7
101 security deprecated synonym for auth
102
103 Valid level names are:
104
105 emerg
106 alert
107 crit
108 err
109 warning
110 notice
111 info
112 debug
113 panic deprecated synonym for emerg
114 error deprecated synonym for err
115 warn deprecated synonym for warning
116
117 For the priority order and intended purposes of these facilities and
118 levels, see syslog(3).
119
121 logger System rebooted
122 logger -p local0.notice -t HOSTIDM -f /dev/idmc
123 logger -n loghost.example.com System rebooted
124
126 syslog(3), syslogd(8)
127
129 The logger command is expected to be IEEE Std 1003.2 ("POSIX.2") com‐
130 patible.
131
133 The logger command is part of the util-linux package and is available
134 from Linux Kernel Archive ⟨ftp://ftp.kernel.org/pub/linux/utils/util-
135 linux/⟩.
136
137
138
139util-linux April 2013 LOGGER(1)