xref: /openbsd-src/usr.bin/logger/logger.1 (revision 3507c921a74fd97669f8086327e1a3192060e0ae)
1*3507c921Sguenther.\"	$OpenBSD: logger.1,v 1.22 2019/06/17 00:23:03 guenther Exp $
2df930be7Sderaadt.\"	$NetBSD: logger.1,v 1.4 1994/12/22 06:26:59 jtc Exp $
3df930be7Sderaadt.\"
4df930be7Sderaadt.\" Copyright (c) 1983, 1990, 1993
5df930be7Sderaadt.\"	The Regents of the University of California.  All rights reserved.
6df930be7Sderaadt.\"
7df930be7Sderaadt.\" Redistribution and use in source and binary forms, with or without
8df930be7Sderaadt.\" modification, are permitted provided that the following conditions
9df930be7Sderaadt.\" are met:
10df930be7Sderaadt.\" 1. Redistributions of source code must retain the above copyright
11df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer.
12df930be7Sderaadt.\" 2. Redistributions in binary form must reproduce the above copyright
13df930be7Sderaadt.\"    notice, this list of conditions and the following disclaimer in the
14df930be7Sderaadt.\"    documentation and/or other materials provided with the distribution.
15f75387cbSmillert.\" 3. Neither the name of the University nor the names of its contributors
16df930be7Sderaadt.\"    may be used to endorse or promote products derived from this software
17df930be7Sderaadt.\"    without specific prior written permission.
18df930be7Sderaadt.\"
19df930be7Sderaadt.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
20df930be7Sderaadt.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21df930be7Sderaadt.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22df930be7Sderaadt.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
23df930be7Sderaadt.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24df930be7Sderaadt.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
25df930be7Sderaadt.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26df930be7Sderaadt.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27df930be7Sderaadt.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28df930be7Sderaadt.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29df930be7Sderaadt.\" SUCH DAMAGE.
30df930be7Sderaadt.\"
31df930be7Sderaadt.\"	@(#)logger.1	8.1 (Berkeley) 6/6/93
32df930be7Sderaadt.\"
33*3507c921Sguenther.Dd $Mdocdate: June 17 2019 $
34df930be7Sderaadt.Dt LOGGER 1
352e0eb34fSaaron.Os
36df930be7Sderaadt.Sh NAME
37df930be7Sderaadt.Nm logger
38df930be7Sderaadt.Nd make entries in the system log
39df930be7Sderaadt.Sh SYNOPSIS
40df930be7Sderaadt.Nm logger
41*3507c921Sguenther.Op Fl cis
42df930be7Sderaadt.Op Fl f Ar file
43df930be7Sderaadt.Op Fl p Ar pri
44df930be7Sderaadt.Op Fl t Ar tag
45df930be7Sderaadt.Op Ar message ...
46df930be7Sderaadt.Sh DESCRIPTION
472e394382SaaronThe
48aea1524aSaaron.Nm logger
492e394382Saaronutility provides a shell command interface to the
50df930be7Sderaadt.Xr syslog 3
51df930be7Sderaadtsystem log module.
52df930be7Sderaadt.Pp
534c2c4eb0SaaronThe options are as follows:
5400a9802eSjmc.Bl -tag -width "-f file"
55*3507c921Sguenther.It Fl c
56*3507c921SguentherIf unable to pass the message to
57*3507c921Sguenther.Xr syslogd 8 ,
58*3507c921Sguentherattempt to write the message to the console.
59fc58f509Sjmc.It Fl f Ar file
60889d88f8SteduRead from the specified
61a2eb159cSlum.Ar file .
62df930be7Sderaadt.It Fl i
63aea1524aSaaronLog the process ID of the logger process
64df930be7Sderaadtwith each line.
65df930be7Sderaadt.It Fl p Ar pri
66df930be7SderaadtEnter the message with the specified priority.
672e0eb34fSaaronThe priority may be specified numerically or as a
682e0eb34fSaaron.Dq facility.level
69df930be7Sderaadtpair.
702e0eb34fSaaronFor example,
71e8d42e3aSjmc.Dq -p local3.info
722e0eb34fSaaronlogs the message(s) as
73df930be7Sderaadt.Ar info Ns rmational
74df930be7Sderaadtlevel in the
75df930be7Sderaadt.Ar local3
76df930be7Sderaadtfacility.
772e0eb34fSaaronThe default is
782e0eb34fSaaron.Dq user.notice .
7900a9802eSjmc.It Fl s
8000a9802eSjmcLog the message to standard error, as well as the system log.
81df930be7Sderaadt.It Fl t Ar tag
82df930be7SderaadtMark every line in the log with the specified
83df930be7Sderaadt.Ar tag .
84df930be7Sderaadt.It Ar message
85df930be7SderaadtWrite the message to log; if not specified, and the
86df930be7Sderaadt.Fl f
87df930be7Sderaadtflag is not
88df930be7Sderaadtprovided, standard input is logged.
89df930be7Sderaadt.El
90f1c64ac4Sjmc.Sh EXIT STATUS
91e8d42e3aSjmc.Ex -std logger
92df930be7Sderaadt.Sh EXAMPLES
9300a9802eSjmc.Bd -literal -offset indent
948be06979Smpech$ logger System rebooted
95df930be7Sderaadt
96e8d42e3aSjmc$ logger -p local0.notice -t HOSTIDM -f /dev/idmc
97df930be7Sderaadt.Ed
98df930be7Sderaadt.Sh SEE ALSO
99df930be7Sderaadt.Xr syslog 3 ,
100df930be7Sderaadt.Xr syslogd 8
101df930be7Sderaadt.Sh STANDARDS
102df930be7SderaadtThe
1037c5a075bSjmc.Nm
1047c5a075bSjmcutility is compliant with the
10599332e38Sjmc.St -p1003.1-2008
1067c5a075bSjmcspecification.
1077c5a075bSjmc.Pp
1087c5a075bSjmcThe flags
109*3507c921Sguenther.Op Fl cfipst
1107c5a075bSjmcare extensions to that specification.
111