Log::R...:Syslog(3pm)
π Log::R...:Syslog(3pm) β User Contributed Perl Documentation π
okay bestie, sit down, hydrate, because we're talking about Log::Report::Dispatcher::Syslog β the module that sends your messages to syslog. yes, that syslog. the big one. let's go β¨
πΈ NAME πΈ
Log::Report::Dispatcher::Syslog β send messages to syslog, bestie π
π¦ INHERITANCE π¦
Log::Report::Dispatcher::Syslog
is a Log::Report::Dispatcher
so it's giving "child of Log::Report::Dispatcher" energy. iconic lineage, no notes π
β¨ SYNOPSIS β¨
# add syslog dispatcher
dispatcher SYSLOG => 'syslog', accept => 'NOTICE-',
format_reason => 'IGNORE',
to_prio => [ 'ALERT-' => 'err' ];
# disable default dispatcher, when daemon
dispatcher close => 'default';
literally just two little blocks and you're set π«Ά
π DESCRIPTION π
This dispatcher produces output to syslog, and it's built on top of the Sys::Syslog module β and listen, Sys::Syslog will NOT be automatically installed for you, because some systems have a whole problem with this dependency. so like, you gotta bring your own. no cap π
The REASON for a message often uses names which are quite similar to the log-levels used by syslog. However: they have a different purpose. The REASON is used by the programmer to indicate the cause of the message β whether it was able to handle a certain situation. The syslog levels, meanwhile, are there for the user's of the program (and with syslog that's usually the system administrators). It is not unusual to see a "normal" error or mistake as a very serious situation in a production environment. So, you may wish to translate any message above reason MISTAKE into a LOG_CRIT. the vibe check says: prod is not the time to be chill π
The default translation table is list below. You can change the mapping using new(to_prio). See example in SYNOPSIS. π
TRACE => LOG_DEBUG ERROR => LOG_ERR
ASSERT => LOG_DEBUG FAULT => LOG_ERR
INFO => LOG_INFO ALERT => LOG_ALERT
NOTICE => LOG_NOTICE FAILURE => LOG_EMERG
WARNING => LOG_WARNING PANIC => LOG_CRIT
MISTAKE => LOG_WARNING
Extends "DESCRIPTION" in Log::Report::Dispatcher. β¨
π§ METHODS π§
Extends "METHODS" in Log::Report::Dispatcher.
π Constructors π
Extends "Constructors" in Log::Report::Dispatcher.
$class->new($type, $name, %options)
With syslog, people tend not to include the REASON of the message in the logs, because that is already used to determine the destination of the message. Improves base, see "Constructors" in Log::Report::Dispatcher.
here's the whole option table, every single one, we're not skipping a thing π«‘
-Option --Defined in --Default
accept Log::Report::Dispatcher depend on mode
charset 'utf8'
facility 'user'
flags 'pid,nowait'
format <unchanged>
format_reason Log::Report::Dispatcher 'IGNORE'
identity <basename C<$0>>
include_domain false
locale Log::Report::Dispatcher <system locale>
logsocket undef
mode Log::Report::Dispatcher 'NORMAL'
to_prio []
accept => $reasons|\@reasonsβ yep, this one's fromLog::Report::Dispatcher, and its default is depend on mode.charset => $charsetβ translate the text-strings into the specified$charset, otherwise the sysadmin may get unreadable text. be kind to your sysadmin fr fr. default is'utf8'β¨facility => $facilityβ the possible values for this depend (a little) on the system. POSIX only defines"user", and"local0"up to"local7". default:'user'.flags => $flagsβ any combination of$flagsas defined bySys::Syslog, as comma-separated string. Examples for flags are:"pid","ndelay", and"nowait". default:'pid,nowait'.format => CODEβ[1.10]with a CODE reference you get your hands on the text before it gets sent to syslog. The three parameters are: the (translated) text, the related text domain object, and the message object. You may want to use context information from the latter. β¨[1.19]After the three positional parameters, there may be a list of pairs (named parameters) with additional info. This may contain a"location"with anARRAYof information produced bycaller()about the origin of the exception. default:<unchanged>.format_reason => 'UPPERCASE'|'LOWERCASE'|'UCFIRST'|'IGNORE'|CODEβ fromLog::Report::Dispatcher, default'IGNORE'.identity => $programβ default is<basename C<$0>>.include_domain => BOOLEANβ[1.00]include the text-domain of the message in each logged message. default:false.locale => LOCALEβ fromLog::Report::Dispatcher, default is the system locale.logsocket => 'unix'|'inet'|'stream'|HASHβ if specified, the log socket type will be initialized to this beforeopenlog()is called. If not specified, the system default is used. default:undef.mode => 'NORMAL'|'VERBOSE'|'ASSERT'|'DEBUG'|0..3β fromLog::Report::Dispatcher, default'NORMAL'.to_prio => \@PAIRSβ seereasonToPrio(). default:[].
π Attributes π
Extends "Attributes" in Log::Report::Dispatcher.
$obj->format( [CODE] )β returns the"CODE"ref which formats the syslog line.$obj->isDisabled()β inherited, see"Attributes" in Log::Report::Dispatcher.$obj->mode()β inherited, see"Attributes" in Log::Report::Dispatcher.$obj->name()β inherited, see"Attributes" in Log::Report::Dispatcher.$obj->needs( [$reason] )β inherited, see"Attributes" in Log::Report::Dispatcher.$obj->type()β inherited, see"Attributes" in Log::Report::Dispatcher.
π Logging π
Extends "Logging" in Log::Report::Dispatcher.
$any->addSkipStack(@CODE)β inherited, see"Logging" in Log::Report::Dispatcher.$obj->close()β inherited, see"Logging" in Log::Report::Dispatcher.$any->collectLocation()β inherited, see"Logging" in Log::Report::Dispatcher.$any->collectStack( [$maxdepth] )β inherited, see"Logging" in Log::Report::Dispatcher.$obj->log(\%options, $reason, $message, $domain)β inherited, see"Logging" in Log::Report::Dispatcher.$obj->reasonToPrio($reason)β returns a level which is understood bysyslog(3), based on a translation table. This can be changed withnew(to_prio). π₯$obj->skipStack()β inherited, see"Logging" in Log::Report::Dispatcher.$any->stackTraceLine(%options)β inherited, see"Logging" in Log::Report::Dispatcher.$obj->translate(\%options, $reason, $message)β inherited, see"Logging" in Log::Report::Dispatcher.
π DETAILS π
Extends "DETAILS" in Log::Report::Dispatcher.
π DIAGNOSTICS π
- Error: max one active syslog dispatcher, attempt for $new have $old Cast by
new() - Error: syslog level '$level' not understood Cast by
new()
π₯ SEE ALSO π₯
This module is part of Log-Report version 1.46, built on June 16, 2026. Website: http://perl.overmeer.net/CPAN/ π
π LICENSE π
For contributors see file ChangeLog.
This software is copyright (c) 2007-2026 by Mark Overmeer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
and that's the whole page bestie, you ate it up π
π«Ά source: perl v5.40.1, dated 2026-07-05, and yeah the footer says Log::R...:Syslog(3pm) β we got there, periodt πΈβ¨
π¦ where this page comes from
- ubuntu stonking: liblog-report-perl 1.46-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms