log4perl icon indicating copy to clipboard operation
log4perl copied to clipboard

unable to subclass Log::Log4perl::Logger

Open XSven opened this issue 1 year ago • 0 comments

Please describe in the Log::Log4perl documentation how to subclass Log::Log4perl::Logger. If this is not possible or undesirable because the class is final this should be documented too. I have tried to subclass Log::Log4perl::Logger without success. From my perspective the general problem is the registry $Log::Log4perl::Logger::LOGGERS_BY_NAME. This registry gets all the time (load time and/or logging initialization time) filled with Log::Log4perl::Logger parent class instances instead of child class instances.

Examples:

At load time of Log::Log4perl::Logger a call of __PACKAGE__->reset(); adds a parent class root logger to the registry.

Logging initialization is based Log::Log4perl::Config. Look at the places where parent class method calls Log::Log4perl::Logger-> are done.

XSven avatar Dec 15 '23 09:12 XSven