Move everything from /var/adm to /var/log
[unleashed.git] / share / man / man1 / logger.1
blobe30efe965867271fa99574c683b818eb0c977807
1 .\"
2 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for
3 .\" permission to reproduce portions of its copyrighted documentation.
4 .\" Original documentation from The Open Group can be obtained online at
5 .\" http://www.opengroup.org/bookstore/.
6 .\"
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
9 .\" documentation.
10 .\"
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
13 .\"
14 .\" Portions of this text are reprinted and reproduced in electronic form
15 .\" in the SunOS Reference Manual, from IEEE Std 1003.1, 2004 Edition,
16 .\" Standard for Information Technology -- Portable Operating System
17 .\" Interface (POSIX), The Open Group Base Specifications Issue 6,
18 .\" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics
19 .\" Engineers, Inc and The Open Group.  In the event of any discrepancy
20 .\" between these versions and the original IEEE and The Open Group
21 .\" Standard, the original IEEE and The Open Group Standard is the referee
22 .\" document.  The original Standard can be obtained online at
23 .\" http://www.opengroup.org/unix/online.html.
24 .\"
25 .\" This notice shall appear on any product containing this material.
26 .\"
27 .\" The Berkeley software License Agreement specifies the terms and conditions
28 .\" for redistribution.
30 .\" The contents of this file are subject to the terms of the
31 .\" Common Development and Distribution License (the "License").
32 .\" You may not use this file except in compliance with the License.
33 .\"
34 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
35 .\" or http://www.opensolaris.org/os/licensing.
36 .\" See the License for the specific language governing permissions
37 .\" and limitations under the License.
38 .\"
39 .\" When distributing Covered Code, include this CDDL HEADER in each
40 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
41 .\" If applicable, add the following below this CDDL HEADER, with the
42 .\" fields enclosed by brackets "[]" replaced with your own identifying
43 .\" information: Portions Copyright [yyyy] [name of copyright owner]
44 .\"
45 .\"
46 .\" Copyright (c) 1983 Regents of the University of California.
47 .\" All rights reserved.
48 .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
49 .\" Copyright (c) 1995, Sun Microsystems, Inc.  All Rights Reserved
50 .\"
51 .TH LOGGER 1 "Feb 1, 1995"
52 .SH NAME
53 logger \- add entries to the system log
54 .SH SYNOPSIS
55 .LP
56 .nf
57 \fBlogger\fR [\fB-i\fR] [\fB-f\fR \fIfile\fR] [\fB-p\fR \fIpriority\fR] [\fB-t\fR \fItag\fR] [\fImessage\fR] ...
58 .fi
60 .SH DESCRIPTION
61 .sp
62 .LP
63 The \fBlogger\fR command provides a method for adding one-line entries to the
64 system log file from the command line. One or more \fImessage\fR arguments can
65 be given on the command line, in which case each is logged immediately. If this
66 is unspecified, either the file indicated with \fB-f\fR or the standard input
67 is added to the log.  Otherwise, a \fIfile\fR can be specified, in which case
68 each line in the file is logged. If neither is specified, \fBlogger\fR reads
69 and logs messages on a line-by-line basis from the standard input.
70 .SH OPTIONS
71 .sp
72 .LP
73 The following options are supported:
74 .sp
75 .ne 2
76 .na
77 \fB\fB-f\fR\fIfile\fR\fR
78 .ad
79 .RS 14n
80 Uses the contents of \fIfile\fR as the message to log.
81 .RE
83 .sp
84 .ne 2
85 .na
86 \fB\fB-i\fR\fR
87 .ad
88 .RS 14n
89 Logs the process \fBID\fR of the \fBlogger\fR process with each line.
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fB\fB-p\fR\fIpriority\fR\fR
96 .ad
97 .RS 14n
98 Enters the message with the specified \fIpriority\fR. The message priority can
99 be specified numerically, or as a \fIfacility\fR\fB\&.\fR\fIlevel\fR pair.  For
100 example, `\fB\fR\fB-p\fR\fB local3.info\fR' assigns the message priority to the
101 \fBinfo\fR level in the \fBlocal3\fR facility.  The default priority is
102 \fBuser.notice\fR.
106 .ne 2
108 \fB\fB-t\fR\fItag\fR\fR
110 .RS 14n
111 Marks each line added to the log with the specified \fItag\fR.
114 .SH OPERANDS
117 The following operand is supported:
119 .ne 2
121 \fB\fImessage\fR\fR
123 .RS 11n
124 One of the string arguments whose contents are concatenated together, in the
125 order specified, separated by single space characters.
128 .SH EXAMPLES
130 \fBExample 1 \fRExamples of the logger command
133 The following example:
136 .in +2
138 example% \fBlogger System rebooted\fR
140 .in -2
145 logs the message `\fBSystem rebooted\fR' to the default priority level
146 \fBnotice\fR to be treated by \fBsyslogd\fR as are other messages to the
147 facility  \fBuser\fR.
151 The next example:
154 .in +2
156 example% \fBlogger -p local0.notice -t HOSTIDM -f /dev/idmc\fR
158 .in -2
163 reads from the file \fB/dev/idmc\fR and logs each line in that file as a
164 message with the tag `\fBHOSTIDM\fR' at priority level \fBnotice\fR to be
165 treated by \fBsyslogd\fR as are other messages to the facility \fBlocal0\fR.
167 .SH ENVIRONMENT VARIABLES
170 See \fBenviron\fR(5) for descriptions of the following environment variables
171 that affect the execution of \fBlogger\fR: \fBLANG\fR, \fBLC_ALL\fR,
172 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
173 .SH EXIT STATUS
176 The following exit values are returned:
178 .ne 2
180 \fB\fB0\fR\fR
182 .RS 6n
183 Successful completion.
187 .ne 2
189 \fB\fB>0\fR\fR
191 .RS 6n
192 An error occurred.
195 .SH ATTRIBUTES
198 See \fBattributes\fR(5) for descriptions of the following attributes:
203 box;
204 c | c
205 l | l .
206 ATTRIBUTE TYPE  ATTRIBUTE VALUE
208 Interface Stability     Standard
211 .SH SEE ALSO
214 \fBmailx\fR(1), \fBwrite\fR(1), \fBsyslogd\fR(8), \fBsyslog\fR(3C),
215 \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)