Unix::Syslog

Perl interface to the UNIX syslog(3) calls
Download

Unix::Syslog Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Marcus Harnisch
  • Publisher web site:
  • http://search.cpan.org/~mharnisch/

Unix::Syslog Tags


Unix::Syslog Description

Perl interface to the UNIX syslog(3) calls Unix::Syslog is a Perl module that provides an interface to the system logger syslogd(8) via Perl's XSUBs. The implementation attempts to resemble the native libc-functions of your system, so that anyone being familiar with syslog.h should be able to use this module right away.In contrary to Sys::Syslog(3), this modules does not open a network connection to send the messages. This can help you to avoid opening security holes in your computer (see "FAQ").The subs imported by the tag macros are simply wrappers around the most important #defines in your system's C header file syslog.h. The macros return integer values that are used to specify options, facilities and priorities in a more or less portable way. They also provide general information about your local syslog mechanism. Check syslog(3) and your local syslog.h for information about the macros, options and facilities available on your system.The following functions are provided:openlog $ident, $option, $facility opens a connection to the system logger. $ident is an identifier string that syslogd(8) prints into every message. It usually equals the process name. $option is an integer value that is the result of ORed options. $facility is an integer value that specifies the part of the system the message should be associated with (e.g. kernel message, mail subsystem).syslog $priority, $format, @formatargs Generates a log message and passes it to the system logger. If syslog() is called without calling openlog() first, probably system dependent default values will be used as arguments for an implicit call to openlog(). $priority is an integer value that specifies the priority of the message. Alternatively $priority can be the ORed value of a priority and a facility. In that case a previously selected facility will be overridden. In the case that syslog() is called without calling openlog() first and priority does not specify both a priority and a facility, a default facility will be used. This behaviour is most likely system dependent and the user should not rely on any particular value in that case. $format is a format string in the style of printf(3). Additionally to the usual printf directives %m can be specified in the string. It will be replaced implicitly by the contents of the Perl variable $! ($ERRNO). @formatargs is a list of values that the format directives will be replaced with subsequently.closelog closes the connection to the system logger.setlogmask $mask_priority sets the priority mask and returns the old mask. Logging is enabled for the priorities indicated by the bits in the mask that are set and is disabled where the bits are not set. Macros are provided to specify valid and portable arguments to setlogmask(). Usually the default log mask allows all messages to be logged.priorityname $priority returns a string containing the name of $priority as string. If this functionality has not been enabled at installation, the function returns undef.facilityname $facility returns a string containing the name of $facility as string. If this functionality has not been enabled at installation, the function returns undef.SYNOPSIS use Unix::Syslog qw(:macros); # Syslog macros use Unix::Syslog qw(:subs); # Syslog functions openlog $ident, $option, $facility; syslog $priority, $format, @formatargs; closelog; $oldmask = setlogmask $mask_priority; Requirements: · Perl


Unix::Syslog Related Software