in reply to Re: Log::Log4perl wrapper + Mason - wrong source file in log
in thread Log::Log4perl wrapper + Mason - wrong source file in log

I was just *stupid*.

Log::Log4perl implements a static object. Thus incrementing the caller_depth for each new logger instance is a very bad idea(tm).

Simply replace
# Increase value value of $Log::Log4perl::caller_depth by one $Log::Log4perl::caller_depth++; # NO NO NO!!!
With this:
# Set value of $Log::Log4perl::caller_depth to one. Since Log4perl's # logger is a static object, the value must not be increased more # than once. $Log::Log4perl::caller_depth = 1;

Andreas
--