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/.
7 .\" The Institute of Electrical and Electronics Engineers and The Open
8 .\" Group, have given us permission to reprint portions of their
11 .\" In the following statement, the phrase ``this text'' refers to portions
12 .\" of the system documentation.
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.
25 .\" This notice shall appear on any product containing this material.
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.
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.
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]
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
51 .TH LOGGER 1 "Feb 1, 1995"
53 logger \- add entries to the system log
57 \fBlogger\fR [\fB-i\fR] [\fB-f\fR \fIfile\fR] [\fB-p\fR \fIpriority\fR] [\fB-t\fR \fItag\fR] [\fImessage\fR] ...
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.
73 The following options are supported:
77 \fB\fB-f\fR\fIfile\fR\fR
80 Uses the contents of \fIfile\fR as the message to log.
89 Logs the process \fBID\fR of the \fBlogger\fR process with each line.
95 \fB\fB-p\fR\fIpriority\fR\fR
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
108 \fB\fB-t\fR\fItag\fR\fR
111 Marks each line added to the log with the specified \fItag\fR.
117 The following operand is supported:
124 One of the string arguments whose contents are concatenated together, in the
125 order specified, separated by single space characters.
130 \fBExample 1 \fRExamples of the logger command
133 The following example:
138 example% \fBlogger System rebooted\fR
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
156 example% \fBlogger -p local0.notice -t HOSTIDM -f /dev/idmc\fR
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.
176 The following exit values are returned:
183 Successful completion.
198 See \fBattributes\fR(5) for descriptions of the following attributes:
206 ATTRIBUTE TYPE ATTRIBUTE VALUE
208 Interface Stability Standard
214 \fBmailx\fR(1), \fBwrite\fR(1), \fBsyslogd\fR(8), \fBsyslog\fR(3C),
215 \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)