Agent:...:Syslog(3pm)

πŸ“¦
version 1.005 Β· 5 versions
, in ubuntu noble, ubuntu resolute, ubuntu stonking

✨ Log::Agent::Driver::Syslog β€” the syslog logging driver for Log::Agent, bestie πŸ’…

okay so real quick before we dive in: this is a page from the User Contributed Perl Documentation, it's Agent:...:Syslog(3pm), and it ships with perl v5.36.0 dated 2022-10-15. keep that in your back pocket, we'll circle back at the end 🫢


🌸 NAME 🌸

Log::Agent::Driver::Syslog β€” the syslog logging driver for Log::Agent πŸ’–

literally what it says on the tin. it's a Log::Agent driver and its whole personality is: syslog.


πŸŽ€ SYNOPSIS πŸŽ€

here's the whole vibe in code, no cap:

use Log::Agent;
require Log::Agent::Driver::Syslog;

my $driver = Log::Agent::Driver::Syslog->make(
    -prefix     => prefix,
    -facility   => "user",
    -showpid    => 1,
    -socktype   => { port => 514, proto => "udp" },
    -logopt     => "ndelay",
);
logconfig(-driver => $driver);

that's it. that's the whole setup. make the driver, hand it to logconfig, go live ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

The syslog logging driver delegates logxxx() operations to syslog() via the Sys::Syslog(3) interface. so all your logging girlies get passed along to syslog through Sys::Syslog(3), okay? that's the whole arrangement. iconic honestly.

The creation routine make() takes the following switches:

  • -facility => facility β€” Tell syslog() which facility to use (e.g. "user", "auth", "daemon"). Unlike the Sys::Syslog(3) interface, the facility is set once and for all: every logging message will use the same facility. so pick your facility and commit, babe, because there is no switching later πŸ’€

If you wish to log something to "auth" for instance, then do so via Sys::Syslog directly: there is no guarantee that the application will configure its Log::Agent to use syslog anyway! like, fr fr, that's on the app, not on you.

  • -logopt => syslog options β€” Specifies logging options, under the form of a string containing zero or more of the words ndelay, cons or nowait. those three words. that's the whole menu πŸ“
  • -prefix => prefix β€” The prefix here is syslog's identification string. yeah it's not a cute little text prefix, it's the ident, okay? don't get it twisted πŸŽ€
  • -showpid => flag β€” Set to true to have the PID of the process logged. It is false by default. so if you want that PID in your logs you gotta ask for it, it's not coming for free πŸ’…
  • -socktype => options β€” Specifies the logging socket to use (protocol, destination, etc.). The value given is not interpreted and passed as-is to the "setlogsock()" routine in Sys::Syslog(3). so whatever you hand it, it hands straight over. no notes, no edits, no vibes check from this driver πŸ™ˆ

Please refer to Log::Agent::Channel::Syslog(3) for more information. go read that one, she's got the tea πŸ‘‘


🌈 CHANNELS 🌈

All the channels go to syslog(), of course. like, obviously. every single one. that's the entire point bestie 😭


πŸ‘‘ AUTHOR πŸ‘‘

Raphael Manfredi <Raphael_Manfredi@pobox.com> β€” the icon who wrote this πŸ’–


πŸ”₯ SEE ALSO πŸ”₯


and that's the page, periodt πŸ’… this was Agent:...:Syslog(3pm) from the User Contributed Perl Documentation, living in perl v5.36.0 and dated 2022-10-15. go log something iconic, bestie πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from