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 the initilize_logging method of Net::Server. it returns a single code ref that will be stored under the log_function property 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 legacy Net::Server::handle_syslog_error method. 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