Adam Thomason > Log-Syslog-Fast-0.61 > Log::Syslog::Fast::Simple

Download:
Log-Syslog-Fast-0.61.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Stalled  1
View/Report Bugs
Source  

NAME ^

Log::Syslog::Fast::Simple - Wrapper around Log::Syslog::Fast that adds some flexibility at the expense of additional runtime overhead.

SYNOPSIS ^

  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);

DESCRIPTION ^

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.

METHODS ^

Log::Syslog::Fast::Simple->new(%params);

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.

proto

Defaults to LOG_UDP

loghost

Defaults to 127.0.0.1

port

Defaults to 514

facility

Defaults to LOG_LOCAL0

severity

Defaults to LOG_INFO

sender

Defaults to Sys::Hostname::hostname

name

Defaults to a cleaned $0

$logger->send($logmsg, [$time], [$severity], [$facility])

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.

EXPORT ^

Same as Log::Syslog::Fast.

SEE ALSO ^

Log::Syslog::Fast

AUTHOR ^

Adam Thomason, <athomason@sixapart.com>

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: