2 .\" Copyright (c) 1983 Regents of the University of California. Copyright (c) 1995, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved All rights reserved. The Berkeley software License Agreement specifies the terms and conditions for redistribution.
3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at
4 .\" http://www.opengroup.org/bookstore/.
5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.
6 .\" This notice shall appear on any product containing this material.
7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
10 .TH LOGGER 1 "Feb 1, 1995"
12 logger \- add entries to the system log
16 \fBlogger\fR [\fB-i\fR] [\fB-f\fR \fIfile\fR] [\fB-p\fR \fIpriority\fR] [\fB-t\fR \fItag\fR] [\fImessage\fR] ...
22 The \fBlogger\fR command provides a method for adding one-line entries to the
23 system log file from the command line. One or more \fImessage\fR arguments can
24 be given on the command line, in which case each is logged immediately. If this
25 is unspecified, either the file indicated with \fB-f\fR or the standard input
26 is added to the log. Otherwise, a \fIfile\fR can be specified, in which case
27 each line in the file is logged. If neither is specified, \fBlogger\fR reads
28 and logs messages on a line-by-line basis from the standard input.
32 The following options are supported:
36 \fB\fB-f\fR\fIfile\fR\fR
39 Uses the contents of \fIfile\fR as the message to log.
48 Logs the process \fBID\fR of the \fBlogger\fR process with each line.
54 \fB\fB-p\fR\fIpriority\fR\fR
57 Enters the message with the specified \fIpriority\fR. The message priority can
58 be specified numerically, or as a \fIfacility\fR\fB\&.\fR\fIlevel\fR pair. For
59 example, `\fB\fR\fB-p\fR\fB local3.info\fR' assigns the message priority to the
60 \fBinfo\fR level in the \fBlocal3\fR facility. The default priority is
67 \fB\fB-t\fR\fItag\fR\fR
70 Marks each line added to the log with the specified \fItag\fR.
76 The following operand is supported:
83 One of the string arguments whose contents are concatenated together, in the
84 order specified, separated by single space characters.
89 \fBExample 1 \fRExamples of the logger command
92 The following example:
97 example% \fBlogger System rebooted\fR
104 logs the message `\fBSystem rebooted\fR' to the default priority level
105 \fBnotice\fR to be treated by \fBsyslogd\fR as are other messages to the
115 example% \fBlogger -p local0.notice -t HOSTIDM -f /dev/idmc\fR
122 reads from the file \fB/dev/idmc\fR and logs each line in that file as a
123 message with the tag `\fBHOSTIDM\fR' at priority level \fBnotice\fR to be
124 treated by \fBsyslogd\fR as are other messages to the facility \fBlocal0\fR.
126 .SH ENVIRONMENT VARIABLES
129 See \fBenviron\fR(5) for descriptions of the following environment variables
130 that affect the execution of \fBlogger\fR: \fBLANG\fR, \fBLC_ALL\fR,
131 \fBLC_CTYPE\fR, \fBLC_MESSAGES\fR, and \fBNLSPATH\fR.
135 The following exit values are returned:
142 Successful completion.
157 See \fBattributes\fR(5) for descriptions of the following attributes:
165 ATTRIBUTE TYPE ATTRIBUTE VALUE
167 Interface Stability Standard
173 \fBmailx\fR(1), \fBwrite\fR(1), \fBsyslogd\fR(1M), \fBsyslog\fR(3C),
174 \fBattributes\fR(5), \fBenviron\fR(5), \fBstandards\fR(5)