1*9d478d44Swiz.\" $NetBSD: logger.1,v 1.17 2020/06/26 15:46:28 wiz Exp $ 27f8ee3fcSjtc.\" 37f8ee3fcSjtc.\" Copyright (c) 1983, 1990, 1993 47f8ee3fcSjtc.\" The Regents of the University of California. All rights reserved. 561f28255Scgd.\" 661f28255Scgd.\" Redistribution and use in source and binary forms, with or without 761f28255Scgd.\" modification, are permitted provided that the following conditions 861f28255Scgd.\" are met: 961f28255Scgd.\" 1. Redistributions of source code must retain the above copyright 1061f28255Scgd.\" notice, this list of conditions and the following disclaimer. 1161f28255Scgd.\" 2. Redistributions in binary form must reproduce the above copyright 1261f28255Scgd.\" notice, this list of conditions and the following disclaimer in the 1361f28255Scgd.\" documentation and/or other materials provided with the distribution. 1489aaa1bbSagc.\" 3. Neither the name of the University nor the names of its contributors 1561f28255Scgd.\" may be used to endorse or promote products derived from this software 1661f28255Scgd.\" without specific prior written permission. 1761f28255Scgd.\" 1861f28255Scgd.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 1961f28255Scgd.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2061f28255Scgd.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2161f28255Scgd.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2261f28255Scgd.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2361f28255Scgd.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2461f28255Scgd.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2561f28255Scgd.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2661f28255Scgd.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2761f28255Scgd.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2861f28255Scgd.\" SUCH DAMAGE. 2961f28255Scgd.\" 307f8ee3fcSjtc.\" @(#)logger.1 8.1 (Berkeley) 6/6/93 3161f28255Scgd.\" 327d3d131cSjruoho.Dd June 25, 2020 3361f28255Scgd.Dt LOGGER 1 349e44e9b5Sgarbled.Os 3561f28255Scgd.Sh NAME 3661f28255Scgd.Nm logger 3761f28255Scgd.Nd make entries in the system log 3861f28255Scgd.Sh SYNOPSIS 392dfca6c3Slukem.Nm 40ed9eb316Schristos.Op Fl cins 41b325f1d9Swiz.Op Fl d Ar SD 4261f28255Scgd.Op Fl f Ar file 43b325f1d9Swiz.Op Fl m Ar msgid 4461f28255Scgd.Op Fl p Ar pri 4561f28255Scgd.Op Fl t Ar tag 4661f28255Scgd.Op Ar message ... 4761f28255Scgd.Sh DESCRIPTION 482dfca6c3Slukem.Nm 4961f28255Scgdprovides a shell command interface to the 5061f28255Scgd.Xr syslog 3 5161f28255Scgdsystem log module. 5261f28255Scgd.Pp 5361f28255ScgdOptions: 54b325f1d9Swiz.Bl -tag -width "messageXX" 55ed9eb316Schristos.It Fl c 567d3d131cSjruohoLog to console as a fallback 577d3d131cSjruoho.Dv ( LOG_CONS ) : 587d3d131cSjruohoif the message cannot be passed to 597d3d131cSjruoho.Xr syslogd 8 , 607d3d131cSjruohothe message is written to 617d3d131cSjruoho.Pa /dev/console . 621c6aec20Schristos.It Fl d Ar sd 631c6aec20SchristosLog this in the structured data (SD) field. 641c6aec20Schristos.Po 651c6aec20Schristos.Ar sd 661c6aec20Schristoshas to be passed as one argument and will require careful quoting when used from 671c6aec20Schristosthe shell. 681c6aec20Schristos.Pc 6961f28255Scgd.It Fl f Ar file 7061f28255ScgdLog the specified file. 71b325f1d9Swiz.It Fl i 72b325f1d9SwizLog the process id of the logger process 73ed9eb316Schristoswith each line 74ed9eb316Schristos.Dv ( LOG_PID ) . 751c6aec20Schristos.It Fl m Ar msgid 761c6aec20SchristosThe MSGID used for the message. 772178b423Snjoly.It Fl n 78ed9eb316SchristosOpen log file immediately 79ed9eb316Schristos.Dv ( LOG_NDELAY ) . 8061f28255Scgd.It Fl p Ar pri 8161f28255ScgdEnter the message with the specified priority. 82b325f1d9SwizThe priority may be specified numerically or as a 83b325f1d9Swiz.Dq facility.level 8461f28255Scgdpair. 85b325f1d9SwizFor example, 86b325f1d9Swiz.Dq \-p local3.info 87b325f1d9Swizlogs the message(s) as 8861f28255Scgd.Ar info Ns rmational 8961f28255Scgdlevel in the 9061f28255Scgd.Ar local3 9161f28255Scgdfacility. 92b325f1d9SwizThe default is 93b325f1d9Swiz.Dq user.notice . 94b325f1d9Swiz.It Fl s 95ed9eb316SchristosLog the message to standard error, as well as the system log 96ed9eb316Schristos.Dv ( LOG_PERROR ) . 9761f28255Scgd.It Fl t Ar tag 9861f28255ScgdMark every line in the log with the specified 9961f28255Scgd.Ar tag . 10061f28255Scgd.It Ar message 10161f28255ScgdWrite the message to log; if not specified, and the 10261f28255Scgd.Fl f 103b325f1d9Swizflag is not provided, standard input is logged. 10461f28255Scgd.El 1053ae25c77Sjruoho.Sh EXIT STATUS 106b325f1d9Swiz.Ex -std logger 10761f28255Scgd.Sh EXAMPLES 10861f28255Scgd.Bd -literal -offset indent -compact 10961f28255Scgdlogger System rebooted 11061f28255Scgd 11161f28255Scgdlogger \-p local0.notice \-t HOSTIDM \-f /dev/idmc 11261f28255Scgd.Ed 11361f28255Scgd.Sh SEE ALSO 11461f28255Scgd.Xr syslog 3 , 11561f28255Scgd.Xr syslogd 8 11661f28255Scgd.Sh STANDARDS 11761f28255ScgdThe 1182dfca6c3Slukem.Nm 11973216f16Sjtcutility conforms to 12073216f16Sjtc.St -p1003.2-92 . 121