Net::Se...Log4perl(3)
π Net::Se...Log4perl(3) β like, the Net::Server logger that speaks Log4perl, bestie
okay so this is a page from the User Contributed Perl Documentation corner of the world, and it's literally all about Net::Server::Log::Log::Log4perl. Yes, the name has "Log" three times. No, that's not a typo. We don't make the rules, we just slay in them. π
β¨ NAME β¨
Net::Server::Log::Log::Log4perl β log via Log4perl. That's it, that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
So first you inherit from a personality, like:
use base qw(Net::Server::PreFork);
and then you run it and hand it the log4perl keys:
__PACKAGE__->run(
log_file => 'Log::Log4perl',
log4perl_conf => '/path/to/my/log4perl.conf',
log4perl_logger => 'myapp',
);
and boom, you're logging through Log4perl. periodt. β¨
π DESCRIPTION π
This module gives the Net::Server system Log::Log4perl-style logging. That's the entire description, it's short and iconic and I respect it. π
π CONFIGURATION π
π log_file
To start using Log4perl logging, literally just set the Net::Server config parameter log_file to "Log::Log4perl".
If you use that magic name "Log::Log4perl", all your logging gets sent to the Log4perl system. And if you do it that way, you can also define log4perl_conf, log4perl_poll, and log4perl_logger. iykyk π
π log4perl_conf
Only available when log_file is equal to "Log::Log4perl". This is the filename of the log4perl configuration file β peep Log::Log4perl for the details.
β οΈ If this is not set, it will die on startup. If the file is not readable, it will die. No cap, it does not play about that config file. π
π§ log4perl_poll
If you set this to a value, it'll initialize with Log::Log4perl::init_and_watch using that polling value. Cute.
It can also be the string "HUP" β which means re-read log4perl_conf whenever a HUP signal comes in. π‘
If you set it to 0, no polling is done at all. Slay. See Log::Log4perl for more details.
π¦ log4perl_logger
This is the facility name. It defaults to "Net::Server". Simple, iconic, main character energy. π
π DEFAULT ARGUMENTS FOR Net::Server π
These 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.)
Heads up bestie, these ones live under the header ## log4perl parameters (if log_file eq Log::Log4perl):
log4perl_confβ value:"filename", default: will die if not set πlog4perl_pollβ value: number orHUP, default:0(no polling)log4perl_loggerβ value:"name", default:"Net::Server"
β METHODS β
π« initialize
This method gets called during the initilize_logging method of Net::Server (yes, that's spelled exactly like that in the original, we keep it, we don't touch it π«Ά).
It returns a single code ref that gets 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. It's giving very elegant, very put-together. β¨
π₯ LICENCE π₯
Distributed under the same terms as Net::Server. π
and that's the whole page, bestie β this was Net::Se...Log4perl(3) from the perl v5.42.0 era, dated 2023-03-15. go forth and log responsibly ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-Net-Server 2.014-bp160.1.12 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms