Net::Se...::Syslog(3)
π Net::Server::Log::Sys::Syslog β log via Syslog π
okay bestie, this is a page from the User Contributed Perl Documentation and it's all about Net::Server::Log::Sys::Syslog, which β as the name is literally giving β logs via Syslog. it's a Perl module page, it's giving very niche, very cunty, and i'm obsessed π«Ά
β¨ NAME β¨
Net::Server::Log::Sys::Syslog β log via Syslog. that's it, that's the whole vibe π
π¦ SYNOPSIS π¦
here's how you actually use it, no cap:
use base qw(Net::Server::PreFork);
__PACKAGE__->run(
log_file => 'Sys::Syslog',
syslog_ident => 'myapp',
);
like. look at that. so clean. so demure. π
πΈ DESCRIPTION πΈ
this module provides Sys::Syslog logging to the Net::Server system. literally that's the whole job and it does it. main character energy fr fr β¨
π CONFIGURATION π
π log_file
to begin using Sys::Syslog logging, simply set the Net::Server log_file configuration parameter to "Sys::Syslog". easy. one line. slay.
if the magic name "Sys::Syslog" is used, all logging will take place via the Sys::Syslog module. and if syslog is used, the parameters "syslog_logsock", "syslog_ident", "syslog_logopt", and "syslog_facility" may also be defined. that's four whole parameters, and they're all listed right below, i gotchu π
π§ syslog_logsock
only available if "log_file" is equal to "Sys::Syslog". it may be either unix, inet, native, console, stream, udp, or tcp, or an arrayref of the types to try. default is "unix" if the version of Sys::Syslog < 0.15 β otherwise the default is to not call setlogsock. kinda picky of it but ok π
see Sys::Syslog.
β syslog_ident
only available if "log_file" is equal to "Sys::Syslog". it's the id to prepend on syslog entries. default is "net_server". see Sys::Syslog. this is your little name tag at the party π
π syslog_logopt
only available if "log_file" is equal to "Sys::Syslog". may be either zero or more of "pid", "cons", "ndelay", "nowait". default is "pid". see Sys::Syslog. mix and match, it's a whole build-your-own-adventure π¦
π₯ syslog_facility
only available if "log_file" is equal to "Sys::Syslog". see Sys::Syslog and syslog. default is "daemon". yes, daemon, spooky little default, we love her π
π DEFAULT ARGUMENTS FOR Net::Server π
the following arguments are available in the default "Net::Server" or "Net::Server::Single" modules. (other personalities may use additional parameters and may optionally not use parameters from the base class.) ngl, that's the tea β
Key Value Default
## syslog parameters (if log_file eq Sys::Syslog)
syslog_logsock (native|unix|inet|udp
|tcp|stream|console) unix (on Sys::Syslog < 0.15)
syslog_ident "identity" "net_server"
syslog_logopt (cons|ndelay|nowait|pid) pid
syslog_facility \w+ daemon
π METHODS π
"initialize"β this method is called during theinitilize_loggingmethod of Net::Server. it returns a single code ref that will be stored under thelog_functionproperty of the Net::Server object. that code ref takes log_level and message as arguments and calls the initialized log4perl system. so it's a little handoff, a little baton pass, iconic behavior π«Ά"handle_log_error"β this method is called if the log_function fails for some reason. it is passed the Net::Server object, the error that occurred while logging, and an arrayref containing the log level and the message. in turn, this calls the legacyNet::Server::handle_syslog_errormethod. like when your main plan flops and you call your reliable friend, ykwim? π
π LICENCE π
distributed under the same terms as Net::Server. periodt. π
real talk bestie: this page is from perl v5.42.0, dated 2023-03-15, and it's part of the User Contributed Perl Documentation. go forth and log responsibly πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Net-Server 2.014-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms