Agent:...Syslog(3pm)
β¨ 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 β tellssyslog()which facility to use (like"user","auth","daemon"β you know the girls). BUT here's the thing: unlike theSys::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, ornowait. 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 tosetlogsock(), so go checkSys::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 withperl v5.36.0, dated2022-10-15, and it still ate π no cap
ok bye bestie, log responsibly, mwah ππβ¨
π¦ where this page comes from
- ubuntu noble: liblog-agent-perl 1.005-2 Β· Artistic-2.0
- ubuntu resolute: liblog-agent-perl 1.005-2 Β· Artistic-2.0
- ubuntu stonking: liblog-agent-perl 1.005-2 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms