Log::Syslog::Fast::Simple - Wrapper around Log::Syslog::Fast that adds some flexibility at the expense of additional runtime overhead.
use Log::Syslog::Fast::Simple; # Simple usage: $logger = Log::Syslog::Fast::Simple->new; $logger->send("log message"); # More customized usage: $logger = Log::Syslog::Fast::Simple->new( loghost => 'myloghost', port => 6666, facility => LOG_LOCAL2, severity => LOG_INFO, sender => 'mymachine', name => 'myapp', ); $logger->send("log message", time, LOG_LOCAL3, LOG_DEBUG);
This module wraps Log::Syslog::Fast to provide a constructor with reasonable defaults and a send() method that optionally accepts override parameters for facility and severity.
Create a new Log::Syslog::Fast::Simple object with given parameters (may be a hash or hashref). Takes the following named parameters which have the same meaning as in Log::Syslog::Fast.
Defaults to LOG_UDP
Defaults to 127.0.0.1
Defaults to 514
Defaults to LOG_LOCAL0
Defaults to LOG_INFO
Defaults to Sys::Hostname::hostname
Defaults to a cleaned $0
Send a syslog message through the configured logger. If $time is not provided, the current time is used. If $severity or $facility are not provided, the default provided at construction time is used.
Same as Log::Syslog::Fast.
Log::Syslog::Fast
Adam Thomason, <athomason@sixapart.com>
Copyright (C) 2009-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.
To install Log::Syslog::Fast, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Log::Syslog::Fast
CPAN shell
perl -MCPAN -e shell install Log::Syslog::Fast
For more information on module installation, please visit the detailed CPAN module installation guide.