Event:...Logger(3pm)

πŸ’– Event::RPC::Logger β€” the perl manpage but make it slay πŸ’–

okay bestie, so we're in the Event:...Logger(3pm) corner of the User Contributed Perl Documentation, and honestly? this little module is lowkey iconic. it's the logging facility for Event::RPC. no cap. ✨


🌸 NAME 🌸

Event::RPC::Logger β€” a whole logging facility for Event::RPC, and she's serving πŸ’…


✨ SYNOPSIS ✨

fr fr, this is how you set her up:

use Event::RPC::Server;
use Event::RPC::Logger;

my $server = Event::RPC::Server->new (
    ...
    logger => Event::RPC::Logger->new(
        filename  => "/var/log/myserver.log",
        fh_lref   => [ $fh, $sock ],
        min_level => 2,
    ),
    ...
);

$server->start;

and then she starts. periodt. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

so this module implements a simple logging facility for the Event::RPC framework. the way that log messages can go to a specific file and/or a whole bunch of filehandles β€” and those filehandles may literally be sockets too, she's flexible like that 🌈


πŸ’œ CONFIGURATION OPTIONS πŸ’œ

here's the list of options you can pass to the new() constructor. not me gatekeeping, i'm sharing everything 🫢

  • filename β€” every single log message gets appended to this file. that's the whole assignment. obsessed.
  • fh_lref β€” all log messages get printed into this list of filehandles. a list, bestie, not just one πŸ‘‘
  • min_level β€” this is the minimum log level. output of messages with a lower level is suppressed (sorry to those messages, they're on mute πŸ™ˆ). you can also change this one with set_min_level() β€” and yes, even while the server is running. main character behavior fr.

🌈 METHODS 🌈

  • $logger->log ( [$level, ] $msg ) β€” the log() method does the actual logging. call it with just one argument and the message gets the default level of 1. call it with two arguments and the first one is the level for the message. easy.
  • $logger->add_fh ( $fh ) β€” this adds a filehandle to the internal list of filehandles that all log messages get written to. one more bestie joining the group chat πŸ’–
  • $logger->remove_fh ( $fh ) β€” removes a filehandle. we love a clean exit ✨

πŸ‘‘ AUTHORS πŸ‘‘

JΓΆrn Reder <joern AT zyn.de>

(i did not invent this person, they're the actual author, respect πŸ’…)


Copyright (C) 2005-2015 by JΓΆrn Reder <joern AT zyn.de>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


lowkey important: that's the whole license situation, and "same terms as Perl itself" is doing a lot of work there, so don't just vibe past it bestie πŸ’€

okay that's genuinely it, she's short and sweet and ate. this was perl v5.40.1, dated 2025-09-29, and it's Event:...Logger(3pm) β€” thanks for coming to my ted talk, mwah πŸ“πŸ§šπŸ’œ

πŸ“¦ where this page comes from