GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Log::Syslog::Constants(3) User Contributed Perl Documentation Log::Syslog::Constants(3)

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

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

  @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_facility('local0');

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 exportable LOG_FTP constant has a value of 11, the value for the FTP facility.

Nothing is exported by default. You may optionally import individual constants and functions or groups of them:

  use Log::Syslog::Constants qw(:severities); # LOG_CRIT, 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

  • get_facility($facility_string)
  • get_severity($severity_string)

    These functions look up a constant value by name, e.g. "get_severity('info') == LOG_INFO".

RFC3164 <http://www.ietf.org/rfc/rfc3164.txt>

Adam Thomason, <athomason@cpan.org>

Copyright (C) 2010-2011 by Say Media, Inc.

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.

2011-03-04 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.