NAME

Log::Syslog::Constants - Perl extension containing syslog priority constants as defined in RFC3164.

SYNOPSIS

use Log::Syslog::Constants ':all';

my @severities = (
  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_SYSLOG, LOG_LPR,
  LOG_NEWS, LOG_UUCP, LOG_CRON, LOG_AUTHPRIV, LOG_FTP, LOG_LOCAL0,
  LOG_LOCAL1, LOG_LOCAL2, LOG_LOCAL3, LOG_LOCAL4, LOG_LOCAL5, LOG_LOCAL6,
  LOG_LOCAL7
);

$info_constant = get_severity('INFO');
$local0_constant = get_severity('local0');

DESCRIPTION

Syslog messages as standardized in RFC3164 embed a priority number (the PRI part) which is composed of a severity and a facility value. The constants which encode these values are specified in section 4.1.1, and are made available by this module. For instance, the LOG_FTP exported constant has a value of 11, the value for the FTP facility.

EXPORTS

Nothing is exported by default. You may optionally import individual constants, all constants for severity and facility levels, or all of them.

use Log::Syslog::Constants qw(:severities); # LOG_CRIT, LOG_NOTICE, LOG_DEBUG, etc
use Log::Syslog::Constants qw(:facilities); # LOG_CRON, LOG_LOCAL3, etc
use Log::Syslog::Constants qw(:functions); # get_facility, get_severity
use Log::Syslog::Constants qw(:all); # all of the above

FUNCTIONS

  • get_facility

  • get_severity

    These functions may be used to get the constants by string name, e.g. get_severity('info') == LOG_INFO.

AUTHOR

Adam Thomason, <athomason@cpan.org>

COPYRIGHT AND LICENSE

Copyright (C) 2010 by Six Apart, Ltd.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.