From: Robert H. <si...@gm...> - 2007-08-21 15:50:19
|
Cees posted this on Perlmonks and it "works" but I get [undef] for filename and line. sub get_logger { my $class = shift; my $module_name = shift; unless( Log::Log4perl->initialized ) { # watch the config file for changes (in seconds) Log::Log4perl->init_and_watch( "log4perl.conf", 60 ); $Log::Log4perl::caller_depth = 1; } return Log::Log4perl->get_logger( $module_name ); } I am not calling it from a module but a "test.pl" file. It logs but I get: [2007/08/21 12:39:21] [WARN] [[undef] line [undef]] This should go to SCREEN and AMG.LOG How do I change my wrapper to play nicely with Log4perl? I am emailing here even though it says "devel" in the title since I don't see a "users" anywhere. : ) Bob |