.\" -*- coding: UTF-8 -*- .\" Written Feb 1994 by Steve Greenland (stevegr@neosoft.com) .\" and Copyright 2001, 2017 Michael Kerrisk .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" Updated 1999.12.19 by Karl M. Hegbloom .\" .\" Updated 13 Oct 2001, Michael Kerrisk .\" Added description of vsyslog .\" Added descriptions of LOG_ODELAY and LOG_NOWAIT .\" Added brief description of facility and option arguments .\" Added CONFORMING TO section .\" 2001-10-13, aeb, minor changes .\" Modified 13 Dec 2001, Martin Schulze .\" Modified 3 Jan 2002, Michael Kerrisk .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH SYSLOG 3 "15 Septiembre 2017" Linux "Manual del Programador de Linux" .SH NOMBRE closelog, openlog, syslog, vsyslog \- envían mensajes al registrador del sistema .SH SINOPSIS \fB#include \fP .PP \fBvoid openlog(const char *\fP\fIident\fP\fB, int \fP\fIoption\fP\fB, int \fP\fIfacility\fP\fB);\fP .br \fBvoid syslog(int \fP\fIpriority\fP\fB, const char *\fP\fIformat\fP\fB, ...);\fP .br \fBvoid closelog(void);\fP .PP \fBvoid vsyslog(int \fP\fIpriority\fP\fB, const char *\fP\fIformat\fP\fB, va_list \fP\fIap\fP\fB);\fP .PP .RS -4 Requisitos de Macros de Prueba de Características para glibc (véase \fBfeature_test_macros\fP(7)): .RE .PP \fBvsyslog\fP(): Since glibc 2.19: _DEFAULT_SOURCE Glibc 2.19 and earlier: _BSD_SOURCE .SH DESCRIPCIÓN .SS openlog() \fBopenlog\fP() opens a connection to the system logger for a program. .PP The string pointed to by \fIident\fP is prepended to every message, and is typically set to the program name. If \fIident\fP is NULL, the program name is used. (POSIX.1\-2008 does not specify the behavior when \fIident\fP is NULL.) .PP The \fIoption\fP argument specifies flags which control the operation of \fBopenlog\fP() and subsequent calls to \fBsyslog\fP(). The \fIfacility\fP argument establishes a default to be used if none is specified in subsequent calls to \fBsyslog\fP(). The values that may be specified for \fIoption\fP and \fIfacility\fP are described below. .PP .\" The use of \fBopenlog\fP() is optional; it will automatically be called by \fBsyslog\fP() if necessary, in which case \fIident\fP will default to NULL. .SS "syslog() y vsyslog()" \fBsyslog\fP() generates a log message, which will be distributed by \fBsyslogd\fP(8). .PP The \fIpriority\fP argument is formed by ORing together a \fIfacility\fP value and a \fIlevel\fP value (described below). If no \fIfacility\fP value is ORed into \fIpriority\fP, then the default value set by \fBopenlog\fP() is used, or, if there was no preceding \fBopenlog\fP() call, a default of \fBLOG_USER\fP is employed. .PP The remaining arguments are a \fIformat\fP, as in \fBprintf\fP(3), and any arguments required by the \fIformat\fP, except that the two\-character sequence \fB%m\fP will be replaced by the error message string \fIstrerror\fP(\fIerrno\fP). The format string need not include a terminating newline character. .PP .\" La función \fBvsyslog\fP() hace la misma tarea que \fBsyslog\fP() con la diferencia de que acepta un conjunto de argumentos que han sido obtenidos usando las macros de \fBstdarg\fP(3) para listas de argumentos variables. .SS closelog() .\" \fBcloselog\fP() closes the file descriptor being used to write to the system logger. The use of \fBcloselog\fP() is optional. .SS "Values for \fIoption\fP" The \fIoption\fP argument to \fBopenlog\fP() is a bit mask constructed by ORing together any of the following values: .TP 15 \fBLOG_CONS\fP Escribe directamente en la consola del sistema si hay un error mientras se está enviando algo al registrador del sistema. .TP \fBLOG_NDELAY\fP Open the connection immediately (normally, the connection is opened when the first message is logged). This may be useful, for example, if a subsequent \fBchroot\fP(2) would make the pathname used internally by the logging facility unreachable. .TP \fBLOG_NOWAIT\fP No espera a los procesos hijo que pueden haber sido creados mientras se registraba el mensaje. (La biblioteca C de GNU no crea un proceso hijo, así que esta opción no tiene efecto en Linux.) .TP \fBLOG_ODELAY\fP La opuesta de \fBLOG_NDELAY\fP; la apertura de la conexión se retrasa hasta que se invoca a \fBsyslog\fP(). (Esta es la opción por defecto, y no necesita ser especificada.) .TP \fBLOG_PERROR\fP (Not in POSIX.1\-2001 or POSIX.1\-2008.) Also log the message to \fIstderr\fP. .TP \fBLOG_PID\fP .\" Include the caller's PID with each message. .SS "Values for \fIfacility\fP" El argumento \fIfacility\fP se emplea para especificar qué tipo de programa está registrando el mensaje. Esto permite que en el fichero de configuración se especifique que mensajes de diferentes programas se manejen de forma distinta. .TP 15 \fBLOG_AUTH\fP mensajes de seguridad o autorización .TP \fBLOG_AUTHPRIV\fP mensajes de seguridad o autorización (privado) .TP \fBLOG_CRON\fP el demonio del reloj (\fBcron\fP y \fBat\fP) .TP \fBLOG_DAEMON\fP demonios del sistema con valor de `facility' separado .TP \fBLOG_FTP\fP demonio de ftp .TP \fBLOG_KERN\fP .\" LOG_KERN has the value 0; if used as a facility, zero translates to: .\" "use the default facility". kernel messages (these can't be generated from user processes) .TP \fBLOG_LOCAL0\fP a \fBLOG_LOCAL7\fP reservados para uso local .TP \fBLOG_LPR\fP subsistema de impresora de línea (de impresión) .TP \fBLOG_MAIL\fP subsistema de correo .TP \fBLOG_NEWS\fP subsistema de tablón de anuncios USENET News .TP \fBLOG_SYSLOG\fP mensajes generados internamente por \fBsyslogd\fP(8) .TP \fBLOG_USER\fP (predeterminado) mensajes genéricos del nivel de usuario .TP \fBLOG_UUCP\fP .\" subsistema de UUCP .SS "Values for \fIlevel\fP" Esto determina la importancia del mensaje. Los niveles son, en orden de importancia decreciente: .TP 15 \fBLOG_EMERG\fP el sistema está inutilizable .TP \fBLOG_ALERT\fP debe tomarse una acción correctora inmediatamente .TP \fBLOG_CRIT\fP condiciones críticas .TP \fBLOG_ERR\fP condiciones de error .TP \fBLOG_WARNING\fP condiciones de advertencia .TP \fBLOG_NOTICE\fP condición normal, pero significativa .TP \fBLOG_INFO\fP mensaje informativo .TP \fBLOG_DEBUG\fP mensaje del nivel de depuración .PP La función \fBsetlogmask\fP(3) puede ser empleada para restringir el registro solamente en niveles determinados. .SH ATRIBUTOS Para obtener una explicación de los términos usados en esta sección, véase \fBattributes\fP(7). .TS allbox; lbw21 lb lb l l l. Interfaz Atributo Valor T{ \fBopenlog\fP(), \fBcloselog\fP() T} Seguridad del hilo Multi\-hilo seguro T{ \fBsyslog\fP(), \fBvsyslog\fP() T} Seguridad del hilo MT\-Safe env locale .TE .SH "CONFORME A" Las funciones \fBopenlog\fP(), \fBcloselog\fP() y \fBsyslog\fP() (pero no \fBvsyslog\fP()) están especificadas en SUSv2, POSIX.1\-2001 y POSIX.1\-2008. .PP POSIX.1\-2001 especifica solamente los valores \fBLOG_USER\fP y \fBLOG_LOCAL*\fP para \fIfacility\fP. Sin embargo, salvo la excepción de \fBLOG_AUTHPRIV\fP y \fBLOG_FTP\fP, los otros valores de \fIfacility\fP aparecen en la mayoría de sistemas UNIX. .PP .\" .SH HISTORY .\" A .\" .BR syslog () .\" function call appeared in 4.2BSD. .\" 4.3BSD documents .\" .BR openlog (), .\" .BR syslog (), .\" .BR closelog (), .\" and .\" .BR setlogmask (). .\" 4.3BSD-Reno also documents .\" .BR vsyslog (). .\" Of course early v* functions used the .\" .I .\" mechanism, which is not compatible with .\" .IR . El valor \fBLOG_PERROR\fP para \fIoption\fP no está especificado por POSIX.1\-2001 o POSIX.1\-2008, pero está disponible en la mayoría de versiones de Unix. .SH NOTAS The argument \fIident\fP in the call of \fBopenlog\fP() is probably stored as\-is. Thus, if the string it points to is changed, \fBsyslog\fP() may start prepending the changed string, and if the string it points to ceases to exist, the results are undefined. Most portable is to use a string constant. .PP Never pass a string with user\-supplied data as a format, use the following instead: .PP .in +4n .EX syslog(priority, "%s", string); .EE .in .SH "VÉASE TAMBIÉN" \fBjournalctl\fP(1), \fBlogger\fP(1), \fBsetlogmask\fP(3), \fBsyslog.conf\fP(5), \fBsyslogd\fP(8) .SH COLOFÓN Esta página es parte de la versión 5.10 del proyecto Linux \fIman\-pages\fP. Puede encontrar una descripción del proyecto, información sobre cómo informar errores y la última versión de esta página en \%https://www.kernel.org/doc/man\-pages/. .SH TRADUCCIÓN La traducción al español de esta página del manual fue creada por Gerardo Aburruzaga García y Miguel Pérez Ibars . Esta traducción es documentación libre; lea la .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE o posterior con respecto a las condiciones de copyright. No existe NINGUNA RESPONSABILIDAD. Si encuentra algún error en la traducción de esta página del manual, envíe un correo electrónico a .MT debian-l10n-spanish@lists.debian.org>. .ME .