[BACK]Return to syslog.3lua CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / share / man / man3lua

File: [cvs.NetBSD.org] / src / share / man / man3lua / syslog.3lua (download)

Revision 1.3, Tue Jan 7 21:54:17 2014 UTC (8 years, 10 months ago) by mbalmer
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, phil-wifi, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: yamt-pagecache, tls-maxphys
Changes since 1.2: +5 -4 lines

Use 5.2 usage pattern in the synopsis.

.\"	$NetBSD: syslog.3lua,v 1.3 2014/01/07 21:54:17 mbalmer Exp $
.\"
.\" Copyright (c) 2013, 2014 Marc Balmer <mbalmer@NetBSD.org>.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\"    notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\"    notice, this list of conditions and the following disclaimer in the
.\"    documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\"    may be used to endorse or promote products derived from this software
.\"    without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"
.Dd January 7, 2014
.Dt SYSLOG 3lua
.Os
.Sh NAME
.Nm syslog
.Nd access
.Xr syslog 3
functionality from Lua
.Sh SYNOPSIS
.Cd "local syslog = require 'syslog'"
.Pp
.Bl -tag -width XXXX -compact
.It Dv syslog.openlog(ident, logopt, facility)
.It Dv syslog.syslog(priority, message)
.It Dv syslog.closelog()
.It Dv oldmask = syslog.setlogmask(maskpri)
.El
.Sh DESCRIPTION
The
.Nm
Lua binding provides access to the
.Xr syslog 3
funcionality.
.Pp
.Bl -tag -width XXXX -compact
.Pp
.It Dv syslog.openlog(ident, logopt, facility)
The syslog.openlog() function provides for more specialized processing of the
messages sent by syslog.syslog().
The parameter
.Ar ident
is a string that will be prepended to every message.
The
.Ar logopt
argument is a bit field specifying logging options, which is formed
by adding one or more of the following values:
.Pp
.Bl -tag -width XXXX -compact
.It Dv syslog.LOG_CONS
If
.Fn syslog.syslog
cannot pass the message to syslogd(8) it will attempt to write the
message to the console (``/dev/console'').
.Pp
.It Dv syslog.LOG_NDELAY
Open the connection to syslogd(8) immediately.
Normally the open is delayed until the first message is logged.
Useful for programs that need to manage the order in which file descriptors are
allocated.
.Pp
.It Dv syslog.LOG_PERROR
Write the message to standard error output as well to the system log.
.Pp
.It Dv syslog.LOG_PID
Log the process id with each message: useful for identifying instantiations of
daemons.
(This PID is placed within brackets between the ident and the message.)
.El
.Pp
The facility parameter encodes a default facility to be assigned to all
messages that do not have an explicit facility encoded:
.Pp
.Bl -tag -width XXXX -compact
.It Dv syslog.LOG_AUTH
The authorization system: login(1), su(1), getty(8), etc.
.Pp
.It Dv syslog.LOG_AUTHPRIV
The same as LOG_AUTH, but logged to a file readable only by selected
individuals.
.Pp
.It Dv syslog.LOG_CRON
The cron daemon: cron(8).
.Pp
.It Dv syslog.LOG_DAEMON
System daemons, such as routed(8), that are not provided for explicitly by other
facilities.
.Pp
.It Dv syslog.LOG_FTP
The file transfer protocol daemon: ftpd(8).
.Pp
.It Dv syslog.LOG_KERN
Messages generated by the kernel.
These cannot be generated by any user processes.
.Pp
.It Dv syslog.LOG_LPR
The line printer spooling system: lpr(1), lpc(8), lpd(8), etc.
.Pp
.It Dv syslog.LOG_MAIL
The mail system.
.Pp
.It Dv syslog.LOG_NEWS
The network news system.
.Pp
.It Dv syslog.LOG_SYSLOG
Messages generated internally by syslogd(8).
.Pp
.It Dv syslog.LOG_USER
Messages generated by random user processes.
This is the default facility identifier if none is specified.
.Pp
.It Dv syslog.LOG_UUCP
The uucp system.
.Pp
.It Dv syslog.LOG_LOCAL0
Reserved for local use.
Similarly for syslog.LOG_LOCAL1 through syslog.LOG_LOCAL7
.El
.Pp
.It Dv syslog.syslog(priority, message)
The
.Fn syslog
function writes
.Ar message
to the system message logger.
The message is then written to the system console, log files, logged-in
users, or forwarded to other machines as appropriate (see syslogd(8)).
.Pp
The
.Ar message
is tagged with
.Ar priority .
Priorities are encoded as a
.Ar facility
and a
.Ar level .
The facility describes the part of the system generating the message.
The level is selected from the following ordered (high to low) list:
.Pp
.Bl -tag -width XXXX -compact
.It Dv syslog.LOG_EMERG
A panic condition.
This is normally broadcast to all users.
.Pp
.It Dv syslog.LOG_ALERT
A condition that should be corrected immediately, such as a corrupted system
database.
.Pp
.It Dv syslog.LOG_CRIT
Critical conditions, e.g., hard device errors.
.Pp
.It Dv syslog.LOG_ERR
Errors.
.Pp
.It Dv syslog.LOG_WARNING
Warning messages.
.Pp
.It Dv syslog.LOG_NOTICE
Conditions that are not error conditions, but should possibly be handled
specially.
.Pp
.It Dv syslog.LOG_INFO
Informational messages.
.Pp
.It Dv syslog.LOG_DEBUG
Messages that contain information normally of use only when debugging a program.
.El
.Pp
.It Dv syslog.closelog()
The
.Fn syslog.closelog
function can be used to close the log file.
.Pp
.It Dv oldmask = syslog.setlogmask(maskpri)
The
.Fn setlogmask
function sets the log priority mask to maskpri and returns the previous mask.
Calls to
.Fn syslog
with a priority not set in maskpri are rejected.
.El
.Sh SEE ALSO
.Xr lua 1 ,
.Xr luac 1 ,
.Xr syslog 3 ,
.Xr intro 3lua ,
.Xr syslogd 8
.Sh HISTORY
A
.Nm
Lua binding manual appeared in
.Nx 7.0 .
.Sh AUTHORS
.An -nosplit
The
.Nm
Lua binding was written by
.An Marc Balmer Aq Mt mbalmer@NetBSD.org .