xref: /openbsd-src/share/man/man9/log.9 (revision 5dfee2283fd7fd95d715914acc2abb87f60de8b3)
1*5dfee228Sschwarze.\"	$OpenBSD: log.9,v 1.11 2015/09/14 15:14:55 schwarze Exp $
28b3caad3Sespie.\"     $NetBSD: log.9,v 1.6 1999/08/17 05:24:06 enami Exp $
38b3caad3Sespie.\"
48b3caad3Sespie.\" Copyright (c) 1997 The NetBSD Foundation, Inc.
58b3caad3Sespie.\" All rights reserved.
68b3caad3Sespie.\"
78b3caad3Sespie.\" This code is derived from software contributed to The NetBSD Foundation
88b3caad3Sespie.\" by Michael Graff.
98b3caad3Sespie.\"
108b3caad3Sespie.\" Redistribution and use in source and binary forms, with or without
118b3caad3Sespie.\" modification, are permitted provided that the following conditions
128b3caad3Sespie.\" are met:
138b3caad3Sespie.\" 1. Redistributions of source code must retain the above copyright
148b3caad3Sespie.\"    notice, this list of conditions and the following disclaimer.
158b3caad3Sespie.\" 2. Redistributions in binary form must reproduce the above copyright
168b3caad3Sespie.\"    notice, this list of conditions and the following disclaimer in the
178b3caad3Sespie.\"    documentation and/or other materials provided with the distribution.
188b3caad3Sespie.\"
198b3caad3Sespie.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
208b3caad3Sespie.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
218b3caad3Sespie.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
228b3caad3Sespie.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
238b3caad3Sespie.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
248b3caad3Sespie.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
258b3caad3Sespie.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
268b3caad3Sespie.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
278b3caad3Sespie.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
288b3caad3Sespie.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
298b3caad3Sespie.\" POSSIBILITY OF SUCH DAMAGE.
308b3caad3Sespie.\"
31*5dfee228Sschwarze.Dd $Mdocdate: September 14 2015 $
328b3caad3Sespie.Dt LOG 9
338b3caad3Sespie.Os
348b3caad3Sespie.Sh NAME
358b3caad3Sespie.Nm log ,
368b3caad3Sespie.Nm addlog
37e34c0550Sschwarze.Nd log a message from the kernel through the /dev/klog device
388b3caad3Sespie.Sh SYNOPSIS
39dddd2645Sschwarze.In sys/syslog.h
408b3caad3Sespie.Ft void
41*5dfee228Sschwarze.Fo log
428b3caad3Sespie.Fa "int level"
438b3caad3Sespie.Fa "const char *format"
448b3caad3Sespie.Fa "..."
458b3caad3Sespie.Fc
468b3caad3Sespie.Ft void
478b3caad3Sespie.Fn addlog "const char *format" ...
488b3caad3Sespie.Sh DESCRIPTION
498b3caad3SespieThe
508b3caad3Sespie.Fn log
518b3caad3Sespiefunction allows the kernel to send formatted messages to user processes
528b3caad3Sespielistening on
538b3caad3Sespie.Pa /dev/klog .
548b3caad3SespieUsually
558b3caad3Sespie.Xr syslogd 8
568b3caad3Sespiemonitors
578b3caad3Sespie.Pa /dev/klog
588b3caad3Sespiefor these messages and writes them to a log file.
598b3caad3Sespie.Pp
608b3caad3SespieAll messages are formatted using
618b3caad3Sespie.Xr printf 9 ,
628b3caad3Sespielogged using facility
638b3caad3Sespie.Dv LOG_KERN ,
648b3caad3Sespieand priority level
658b3caad3Sespie.Fa level .
668b3caad3Sespie.Pp
678b3caad3SespieThe
688b3caad3Sespie.Fn addlog
698b3caad3Sespiefunction is used to build a log message in steps, by adding information
708b3caad3Sespieto an initial call to
718b3caad3Sespie.Fn log .
728b3caad3Sespie.Sh SEE ALSO
738b3caad3Sespie.Xr syslog 3 ,
748b3caad3Sespie.Xr syslogd 8 ,
754a0a8a45Saaron.Xr printf 9
76