summaryrefslogtreecommitdiffstats
path: root/misc-utils/logger.1
blob: d863ac3a75c88f4eceb6e4e787115c99c449b6c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
.\" 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
.\"
.\" Section on valid facility and level strings added by
.\" and1000@debian.org, 26 Oct 1997.
.TH LOGGER "1" "September 2011" "util-linux" "User Commands"
.SH NAME
logger \- a shell command interface to the syslog(3) system log module
.SH SYNOPSIS
.B logger
[options] [message]
.SH DESCRIPTION
.B logger
makes entries in the system log.  It provides a shell command
interface to the
.BR syslog (3)
system log module.
.SH OPTIONS
.TP
\fB\-d\fR, \fB\-\-udp\fR
Use datagram (UDP) instead of the default stream connection (TCP).
.TP
\fB\-i\fR, \fB\-\-id\fR
Log the process ID of the logger process with each line.
.TP
\fB\-f\fR, \fB\-\-file\fR \fIfile\fR
Log the contents of the specified
.IR file .
This option cannot be combined with a command-line message.
.TP
\fB\-h\fR, \fB\-\-help\fR
Display a help text and exit.
.TP
\fB\-n\fR, \fB\-\-server\fR \fIserver\fR
Write to the specified remote syslog
.I server
using UDP instead of to the builtin syslog routines.
.TP
\fB\-P\fR, \fB\-\-port\fR \fIport\fR
Use the specified UDP
.IR port .
The default port number is 514.
.TP
\fB\-p\fR, \fB\-\-priority\fR \fIpriority\fR
Enter the message into the log with the specified
.IR priority  .
The priority may be specified numerically or as a
.I facility.level
pair.
For example,
.B -p
.I local3.info
logs the message as informational in the local3 facility.
The default is
.IR user.notice .
.TP
\fB\-s\fR, \fB\-\-stderr\fR
Output the message to standard error as well as to the system log.
.TP
\fB\-t\fR, \fB\-\-tag\fR \fItag\fR
Mark every line to be logged with the specified
.IR tag .
.TP
\fB\-u\fR, \fB\-\-socket\fR \fIsocket\fR
Write to the specified
.I socket
instead of to the builtin syslog routines.
.TP
\fB\-V\fR, \fB\-\-version\fR
Display version information and exit.
.TP
\fB\-\-\fR
End the argument list.  This is to allow the
.I message
to start with a hyphen (\-).
.TP
.I message
Write the message to log; if not specified, and the
.I \-f
flag is not provided, standard input is logged.
.PP
The
.B logger
utility exits 0 on success, and >0 if an error occurs.
.PP
Valid facility names are:
.IR auth , \ authpriv
(for security information of a sensitive nature),
.IR cron , \ daemon , \ ftp , \ kern
(can't be generated from user process),
.IR lpr , \ mail , \ news , \ security
(deprecated synonym for
.IR auth ), \ syslog , \ user , \ uucp ,
and
.IR local0 \ to \ local7 ,
inclusive.
.PP
Valid level names are:
.IR alert , \ crit , \ debug , \ emerg , \ err , \ error
(deprecated synonym for
.IR err ), \ info , \ notice , \ panic
(deprecated synonym for
.IR  emerg ), \ warning , \ warn
(deprecated synonym for
.IR warning ).
For the priority order and intended purposes of these levels, see
.BR syslog (3).
.SH EXAMPLES
logger System rebooted
.br
logger \-p local0.notice \-t HOSTIDM \-f /dev/idmc
.br
logger \-n loghost.example.com System rebooted
.SH SEE ALSO
.BR syslog (3),
.BR syslogd (8)
.SH STANDARDS
The
.B logger
command is expected to be IEEE Std 1003.2 ("POSIX.2") compatible.
.SH AVAILABILITY
The logger command is part of the util-linux package and is available from
.UR ftp://\:ftp.kernel.org\:/pub\:/linux\:/utils\:/util-linux/
Linux Kernel Archive
.UE .