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

I'm not sure I follow...

What happens if you just don't increment caller_depth? Or increment it twice?

I'm unfamiliar with both Mason and log4perl, so these may not be helpful suggestions. But they seem like the natural things to try.

If that doesn't work, looking at the whole caller backtrace will probably cause a bright light to come on. :)

I'm guessing Mason's event handling control flow is probably a bit different from what your mental model of it is.


Mike
  • Comment on Re: Log::Log4perl wrapper + Mason - wrong source file in log

Replies are listed 'Best First'.
Re: Re: Log::Log4perl wrapper + Mason - wrong source file in log
by andreas1234567 (Vicar) on Jan 15, 2004 at 15:56 UTC
    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
    --