Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

logger::syslog(3pm) [debian man page]

Logger::Syslog(3pm)					User Contributed Perl Documentation				       Logger::Syslog(3pm)

NAME
Logger::Syslog -- an intuitive wrapper over Syslog for Perl DESCRIPTION
You want to deal with syslog, but you don't want to bother with Sys::Syslog, that module is for you. Logger::Syslog takes care of everything regarding the Syslog communication, all you have to do is to use the function you need to send a message to syslog. Logger::Syslog provides one function per Syslog message level: debug, info, warning, error, notice, critic, alert. NOTES
Logger::Syslog is compliant with mod_perl, all you have to do when using it in such an environement is to call logger_init() at the beginning of your CGI, that will garantee that everything will run smoothly (otherwise, issues with the syslog socket can happen in mod_perl env). SYNOPSIS
use Logger::Syslog; info("Starting at ".localtime()); ... if ($error) { error("An error occured!"); exit 1; } ... notice("There something to notify"); FUNCTIONS
logger_init Call this to explicitly open a Syslog socket. You can optionaly specify a Syslog facility. That function is called when you use the module, if you're not in a mod_perl environement. Examples: # open a syslog socket with default facility (user) logger_init(); # open a syslog socket on the 'local' facility logger_init('local'); logger_close Call this to close the Syslog socket. That function is called automatically when the calling program exits. logger_prefix That function lets you set a string that will be prefixed to every messages sent to syslog. Example: logger_prefix("my program"); info("starting"); ... info("stopping"); logger_set_default_facility(facility) You can choose which facility to use, the default one is "user". Use that function if you want to switch smoothly from a facility to another. That function will close the existing socket and will open a new one with the appropriate facility. Example: logger_set_default_facility("cron"); LOGGING
Logger::Syslog provides one function per Syslog level to let you send messages. If you want to send a debug message, just use debug(), for a warning, use warning() and so on... All those function have the same signature : thay take a string as their only argument, which is the message to send to syslog. Examples: debug("my program starts at ".localtime()); ... warning("some strange stuff occured"); ... error("should not go there !"); ... notice("Here is my notice"); LICENSE
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. COPYRIGHT
This program is copyright X 2004-2006 Alexis Sukrieh AUTHOR
Alexis Sukrieh <sukria@sukria.net> Very first versions were made at Cegetel (2004-2005) ; Thomas Parmelan gave a hand for the mod_perl support. perl v5.12.4 2006-11-27 Logger::Syslog(3pm)

Check Out this Related Man Page

Log::Dispatch::Syslog(3pm)				User Contributed Perl Documentation				Log::Dispatch::Syslog(3pm)

NAME
Log::Dispatch::Syslog - Object for logging to system log. VERSION
version 2.32 SYNOPSIS
use Log::Dispatch; my $log = Log::Dispatch->new( outputs => [ [ 'Syslog', min_level => 'info', ident => 'Yadda yadda' ] ] ); $log->emerg("Time to die."); DESCRIPTION
This module provides a simple object for sending messages to the system log (via UNIX syslog calls). Note that logging may fail if you try to pass UTF-8 characters in the log message. If logging fails and warnings are enabled, the error message will be output using Perl's "warn". CONSTRUCTOR
The constructor takes the following parameters in addition to the standard parameters documented in Log::Dispatch::Output: o ident ($) This string will be prepended to all messages in the system log. Defaults to $0. o logopt ($) A string containing the log options (separated by any separator you like). See the openlog(3) and Sys::Syslog docs for more details. Defaults to ''. o facility ($) Specifies what type of program is doing the logging to the system log. Valid options are 'auth', 'authpriv', 'cron', 'daemon', 'kern', 'local0' through 'local7', 'mail, 'news', 'syslog', 'user', 'uucp'. Defaults to 'user' o socket ($ or @) Tells what type of socket to use for sending syslog messages. Valid options are listed in "Sys::Syslog". If you don't provide this, then we let "Sys::Syslog" simply pick one that works, which is the preferred option, as it makes your code more portable. If you pass an array reference, it is dereferenced and passed to "Sys::Syslog::setlogsock()". AUTHOR
Dave Rolsky <autarch@urth.org> COPYRIGHT AND LICENSE
This software is Copyright (c) 2011 by Dave Rolsky. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) perl v5.14.2 2012-05-25 Log::Dispatch::Syslog(3pm)
Man Page