From 609b3d572c499e705c3cef67348d9c57a693bef8 Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Wed, 15 May 1985 23:11:54 -0800 Subject: [PATCH] manual page first distributed with 4.2BSD SCCS-vsn: lib/libc/gen/syslog.3 5.1 --- usr/src/lib/libc/gen/syslog.3 | 73 +++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 usr/src/lib/libc/gen/syslog.3 diff --git a/usr/src/lib/libc/gen/syslog.3 b/usr/src/lib/libc/gen/syslog.3 new file mode 100644 index 0000000000..8700dd0a73 --- /dev/null +++ b/usr/src/lib/libc/gen/syslog.3 @@ -0,0 +1,73 @@ +.\" Copyright (c) 1983 Regents of the University of California. +.\" All rights reserved. The Berkeley software License Agreement +.\" specifies the terms and conditions for redistribution. +.\" +.\" @(#)syslog.3 5.1 (Berkeley) %G% +.\" +.\" @(#)syslog.3 1.2 11/14/82 +.TH SYSLOG 3 "14 November 1982" +.UC 5 +.SH NAME +syslog, openlog, closelog \- control system log +.SH SYNOPSIS +.B "#include +.PP +.B "openlog(ident, logstat) +.br +.B "char *ident; +.PP +.B "syslog(priority, message, parameters ... ) +.br +.B "char *message; +.PP +.B "closelog() +.SH DESCRIPTION +.I Syslog +arranges to write the +.I message +onto the system log maintained by +.IR syslog (8). +The message is tagged with +.IR priority . +The message looks like a +.IR printf (3) +string except that +.B %m +is replaced by the current error message (collected from +.IR errno ). +A trailing newline is added if needed. +This message will be read by +.IR syslog (8) +and output to the system console or files as appropriate. +.PP +If special processing is needed, +.I openlog +can be called to initialize the log file. +Parameters are +.I ident +which is prepended to every message, and +.I logstat +which is a bit field indicating special status; current values are: +.IP LOG_PID \w'LOG_PID'u+3 +log the process id with each message: +useful for identifying instantiations of daemons. +.LP +.I Openlog +returns zero on success. +If it cannot open the file +.I /dev/log, +it writes on +.I /dev/console +instead and returns \-1. +.PP +.I Closelog +can be used to close the log file. +.SH EXAMPLES +.nf +syslog(LOG_SALERT, "who: internal error 23"); + +openlog("serverftp", LOG_PID); +syslog(LOG_INFO, "Connection from host %d", CallingHost); +.fi +.SH "SEE ALSO +syslog(8) -- 2.20.1