NetSDS::Logger(3pm)
π NetSDS::Logger π
okay bestie, so this is a page from the User Contributed Perl Documentation β a whole little syslog wrapper for your apps and your classes, and we're gonna get into it. pull up a chair. π«Ά
β¨ NAME β¨
NetSDS::Logger β a syslog wrapper for applications and classes. it's giving "logging, but make it a whole module." π
πΈ SYNOPSIS πΈ
use NetSDS::Logger;
my $logger = NetSDS::Logger->new(
name => 'NetSDS-SuperDaemon',
);
$logger->log("info", "Syslog message here");
look at her go. she's logging. she's thriving. π₯
π¦ DESCRIPTION π¦
so this module is literally the whole logging functionality implementation for NetSDS components. that's her job. that's what she does.
by default, messages get logged with the local0 facility and the pid,ndelay,nowait options. no cap, those are the defaults, don't come for me.
NOTE: theNetSDS::Loggermodule is for internal use, mostly from application frameworks likeNetSDS::App,NetSDS::App::FCGI, etc. so like, she's not really out here for the general public β she's the backstage queen, not the main stage girlie. π
π CLASS API π
new(%parameters) β the constructor π
new() creates a brand new logger object and opens a socket with the default NetSDS logging parameters. it's giving "hello world, but make it syslog."
the arguments allowed (as a hash, bestie, it's a hash):
nameβ the application name, for identification purposes.
use only ASCII characters in name to avoid possible errors. fr fr, keep it ASCII or chaos ensues. π
the default value is NetSDS.
facilityβ the logging facility.
the available facility values are:
local0..local7userdaemon
if it's not set, local0 gets used as the default value. iconic default behavior. β
log($level, $message) β write a record to the log β¨
this is a wrapper to the syslog() method of the Unix::Syslog module. shoutout Unix::Syslog. π«Ά
the level gets passed as a string and it may be one of the following:
alertβLOG_ALERTcritβLOG_CRITdebugβLOG_DEBUGemergβLOG_EMERGerrorβLOG_ERRinfoβLOG_INFOnoticeβLOG_NOTICEwarningβLOG_WARNING
pick your vibe, bestie. one of those. that's the whole menu. π
DESTROY β the class destructor π
the destructor (the DESTROY method, iykyk) calls the closelog() function.
that's it. that's all she does. no notes. clean exit. slay. π
π EXAMPLES π
see NetSDS::App for an example. yes really, that's the whole section. go look. π§
π SEE ALSO π
Sys::Syslog
π TODO π
- implement logging via UDP socket.
(she's not done yet, she's got plans. we love a girl with goals. π)
π AUTHOR π
Michael Bochkaryov <misha@rattler.kiev.ua>
π LICENSE π
Copyright (C) 2008-2009 Net Style Ltd.
this program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
this program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. see the GNU General Public License for more details.
you should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
aaaand that's the whole page, bestie!! this one shipped as perl v5.32.1, dated 2021-12-26, under the NetSDS::Logger(3pm) name β go log something iconic, mwah πβ¨
π¦ where this page comes from
- debian bookworm: libnetsds-perl 1.301-4 Β· GPL-2.0-or-later
- debian trixie: libnetsds-perl 1.301-4 Β· GPL-2.0-or-later
- ubuntu jammy: libnetsds-perl 1.301-4 Β· GPL-2.0-or-later
- ubuntu noble: libnetsds-perl 1.301-4 Β· GPL-2.0-or-later
- ubuntu resolute: libnetsds-perl 1.301-4 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms