in reply to Log::Log4Perl best practices
then each module needs to start out withWell, it's still one line less than log4j :-)
use Log::Log4perl qw(:levels); my $logger = Log::Log4perl->get_logger(__PACKAGE__); $logger->level($DEBUG);
I'm not sure you're supposed to set your own log-level inside the code since one of the strong points of Log4perl is that you can change log-levels using the config files while the program is running...
Anyway, you could make your own wrapper module and mess around with import and caller to let it be used like this:
or evenuse Mylog; #... $LOG->warn("bla"); # $LOG is presumably a package global
use MyLog 'debug'; $LOG->warn("stuff");