Copyright (C) 2000-2012 |
GNU Info (python2.1-lib.info)syslogUNIX syslog library routines ============================ An interface to the UNIX syslog library routines. This module provides an interface to the UNIX `syslog' library routines. Refer to the UNIX manual pages for a detailed description of the `syslog' facility. The module defines the following functions: `syslog([priority,] message)' Send the string MESSAGE to the system logger. A trailing newline is added if necessary. Each message is tagged with a priority composed of a FACILITY and a LEVEL. The optional PRIORITY argument, which defaults to `LOG_INFO', determines the message priority. If the facility is not encoded in PRIORITY using logical-or (`LOG_INFO | LOG_USER'), the value given in the `openlog()' call is used. `openlog(ident[, logopt[, facility]])' Logging options other than the defaults can be set by explicitly opening the log file with `openlog()' prior to calling `syslog()'. The defaults are (usually) IDENT = `'syslog'', LOGOPT = `0', FACILITY = `LOG_USER'. The IDENT argument is a string which is prepended to every message. The optional LOGOPT argument is a bit field - see below for possible values to combine. The optional FACILITY argument sets the default facility for messages which do not have a facility explicitly encoded. `closelog()' Close the log file. `setlogmask(maskpri)' Set the priority mask to MASKPRI and return the previous mask value. Calls to `syslog()' with a priority level not set in MASKPRI are ignored. The default is to log all priorities. The function `LOG_MASK(PRI)' calculates the mask for the individual priority PRI. The function `LOG_UPTO(PRI)' calculates the mask for all priorities up to and including PRI. The module defines the following constants: `Priority levels (high to low):' `LOG_EMERG', `LOG_ALERT', `LOG_CRIT', `LOG_ERR', `LOG_WARNING', `LOG_NOTICE', `LOG_INFO', `LOG_DEBUG'. `Facilities:' `LOG_KERN', `LOG_USER', `LOG_MAIL', `LOG_DAEMON', `LOG_AUTH', `LOG_LPR', `LOG_NEWS', `LOG_UUCP', `LOG_CRON' and `LOG_LOCAL0' to `LOG_LOCAL7'. `Log options:' `LOG_PID', `LOG_CONS', `LOG_NDELAY', `LOG_NOWAIT' and `LOG_PERROR' if defined in `<syslog.h>'. automatically generated by info2www version 1.2.2.9 |