2 .\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved. Copyright (c) 1983 Regents of the University of California. All rights reserved. The Berkeley software
3 .\" License Agreement specifies the terms and conditions for redistribution.
4 .TH LOGGER 1B "Sep 14, 1992"
6 logger \- add entries to the system log
10 \fB/usr/ucb/logger\fR [\fB-f\fR \fIfilename\fR] [\fB-i\fR] [\fB-p\fR \fIpriority\fR] [\fB-t\fR \fItag\fR] mm
17 The \fBlogger\fR utility provides a method for adding one-line entries to the
18 system log file from the command line. One or more \fImessage\fR arguments can
19 be given on the command line, in which case each is logged immediately. If
20 \fImessage\fR is unspecified, either the file indicated with \fB-f\fR or the
21 standard input is added to the log. Otherwise, a \fIfilename\fR can be
22 specified, in which case each line in the file is logged. If neither is
23 specified, \fBlogger\fR reads and logs messages on a line-by-line basis from
28 The following options are supported:
35 Log the process \fBID\fR of the \fBlogger\fR process with each line.
41 \fB\fB-f\fR \fIfilename\fR\fR
44 Use the contents of \fIfilename\fR as the message to log.
50 \fB\fB-p\fR \fIpriority\fR\fR
53 Enter the message with the specified \fIpriority\fR. The message priority can
54 be specified numerically, or as a \fIfacility.level\fR pair. For example,
55 \fB`\fR\fB-p\fR \fBlocal3.info'\fR assigns the message priority to the
56 \fBinfo\fR level in the \fBlocal3\fR facility. The default priority is
63 \fB\fB-t\fR \fItag\fR\fR
66 Mark each line added to the log with the specified \fItag\fR.
71 \fBExample 1 \fRLogging a message
79 example% \fBlogger System rebooted\fR
86 will log the message `\fBSystem rebooted\fR' to the facility at priority
87 \fBnotice\fR to be treated by \fBsyslogd\fR as other messages to the facility
91 \fBExample 2 \fRLogging messages from a file
99 example% \fBlogger \fR\fB-p\fR\fB local0.notice \fR\fB-t\fR\fB HOSTIDM \fR\fB-f\fR\fB /dev/idmc\fR
106 will read from the file \fB/dev/idmc\fR and will log each line in that file as
107 a message with the tag `\fBHOSTIDM\fR' at priority \fBnotice\fR to be treated
108 by \fBsyslogd\fR as other messages to the facility \fBlocal0\fR are.
113 \fBsyslogd\fR(1M), \fBsyslog\fR(3C), \fBattributes\fR(5)