Hi,
I've used Log::Log4perl for some time (thanks) and also written
DBIx::Log4perl but the caller_depth is now getting in my way and
wondered what anyone else did. I have (as an example):
program.pl - this uses Log::Log4perl to log at "myspace::myprogram"
program.pl uses DBIx::Log4perl which logs at "DBIx::Log4perl"
but DBIx::Log4perl is effectively a wrapper around DBI so it sets the
caller_depth to 2 in DBIx::Log4perl with:
BEGIN {
# when Log4perl logs where the log message were output get it to
# ignore the lowest 2 levels of the stack i.e. DBIx::Log4perl.
$Log::Log4perl::caller_depth = 2;
}
Problem is that this seems to get inherited for all Log4perl instances
I've got so dies in program.pl show:
[undef]:[undef] main::
instead of:
program.pl:1017 main::
Is it possible to have different caller depths?
Thanks
Martin
--
Martin J. Evans
Easysoft Limited
http://www.easysoft.com
|