Agent:...Syslog(3pm)

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

✨ NAME ✨

ok so this is Agent:...Syslog(3pm) β€” yes bestie, the <pink>User Contributed Perl Documentation</pink> one, from the Agent:... family πŸ’… β€” and it's the syslog logging channel for Log::Agent::Logger. it's giving "my logs go to syslog now, and they slay" πŸŽ€


🌸 SYNOPSIS 🌸

require Log::Agent::Channel::Syslog;

my $channel = Log::Agent::Channel::Syslog->make(
    # Specific attributes
    -prefix     => prefix,
    -facility   => "user",
    -showpid    => 1,
    -socktype   => { port => 514, type => "udp" },
    -logopt     => "ndelay",
);

that's the whole vibe up top, and yes we're about to break down every single one of those switches 🫢


πŸ’– DESCRIPTION πŸ’–

so the syslog logging channels (plural, she's versatile) sends literally everything over to syslog() through the Sys::Syslog(3) interface. that's the tea β˜•

the creation routine make() takes the following switches, and you will be reading all of them:

  • -facility => facility β€” tells syslog() which facility to use (like "user", "auth", "daemon" β€” you know the girls). BUT here's the thing: unlike the Sys::Syslog(3) interface, this facility is set once and for all. every single message logged through this channel uses the same facility. no switching up mid-run, she said consistency periodt πŸ’…
  • -logopt => syslog options β€” the logging options, given as a string with zero or more of these words: ndelay, cons, or nowait. that's the whole menu, bestie ✨
  • -prefix => prefix β€” the prefix here is syslog's identification string. that's her whole job, iconic πŸŽ€
  • -showpid => flag β€” set it to true and the PID of the process gets logged too. it's false by default, so if you want the PID drama you gotta ask for it 🧚
  • -socktype => options β€” this configures the logging socket. now listen: the options you give get passed without interpretation straight to setlogsock(), so go check Sys::Sylog(3) for the exhaustive set of configuration options over there (yes that's how it's spelled in the original, no I will not be fixing it, that's between you and the manpage 😭).

so like, if you're running rsyslogd over TCP on a non-standard port 60514 for instance, you could say:

        -socktype => { port => 60514, type => "tcp" }

but fr fr there are many other configuration possibilities. go wild 🌈


πŸ‘‘ AUTHOR πŸ‘‘

Raphael Manfredi <Raphael_Manfredi@pobox.com> β€” the main character who wrote this, we stan πŸ’œ


πŸ”₯ SEE ALSO πŸ”₯

go read those next, iykyk πŸ“š


lowkey reminder that this doc came with perl v5.36.0, dated 2022-10-15, and it still ate πŸ’… no cap

ok bye bestie, log responsibly, mwah πŸ“πŸ’–βœ¨

πŸ“¦ where this page comes from