Re: [log4perl-devel] Can caller_depth be set per logger

2008-02-07 Thread Kevin M. Goess
Martin,

Have you tried something like this?  It would go in each wrapper method
in your st.pm and db.pm, at the beginning of the method:

local $Log::Log4perl::caller_depth =
   $Log::Log4perl::caller_depth + 2;

It's a package variable, so no, there is no other way to set it per-logger.

There's some discussion of this in the FAQ ("perldoc Log::Log4perl::FAQ").




Martin J. Evans wrote:
> Hi,
> 
> I mailed this question some months ago and did not get any response so I 
> thought I'd have one last go slightly reworded.
> 
> I have many different loggers in the same application in the program 
> itself and various modules. One module is a wrapper class around DBI and 
> has to set the caller_depth to 2 but caller_depth seems to be global and 
> hence this affects all other loggers in the same program. Is there any 
> way to set caller_depth per logger?
> 
> My precise example was in my post on this list 3-dec-07.
> 
> Thanks
> 
> Martin


-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel


[log4perl-devel] Can caller_depth be set per logger

2008-02-07 Thread Martin J. Evans
Hi,

I mailed this question some months ago and did not get any response so I 
thought I'd have one last go slightly reworded.

I have many different loggers in the same application in the program 
itself and various modules. One module is a wrapper class around DBI and 
has to set the caller_depth to 2 but caller_depth seems to be global and 
hence this affects all other loggers in the same program. Is there any 
way to set caller_depth per logger?

My precise example was in my post on this list 3-dec-07.

Thanks

Martin
-- 
Martin J. Evans
Easysoft Limited
http://www.easysoft.com

-
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/
___
log4perl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel