Log::Dispatch::Syslog - Object for logging to system log.
use Log::Dispatch; my $log = Log::Dispatch->new( outputs => [ [ 'Syslog', min_level => 'info', ident => 'Yadda yadda' ] ] ); $log->emerg("Time to die.");
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
The constructor takes the following parameters in addition to the standard parameters documented in Log::Dispatch::Output:
This string will be prepended to all messages in the system log. Defaults to $0.
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 ''.
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'
Tells what type of socket to use for sending syslog messages. Valid options are listed in
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
If you pass a hash reference, it is passed to
Sys::Syslog::setlogsock() as is.
If this is set to a true value, then the calls to
closelog() will all be guarded by a thread-locked variable.
This defaults to false.
Bugs may be submitted at https://github.com/houseabsolute/Log-Dispatch/issues.
I am also usually active on IRC as 'autarch' on
The source code repository for Log-Dispatch can be found at https://github.com/houseabsolute/Log-Dispatch.
Dave Rolsky <firstname.lastname@example.org>
This software is Copyright (c) 2017 by Dave Rolsky.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
The full text of the license can be found in the LICENSE file included with this distribution.