Todd, I think this is what you want: Using Log::Log4perl from wrapper classes If you don't use "Log::Log4perl" as described above, but from a wrapper class (like your own Logging class which in turn uses "Log::Log4perl"), the pattern layout will generate wrong data for %F, %C, %L and the like. Reason for this is that Log::Log4perl"'s loggers assume a static caller depth to the application that's using them. If you're using one (or more) wrapper classes, "Log::Log4perl" will indicate where your logger classes called the loggers, not where your application called your wrapper, which is probably what you want in this case. But don't despair, there's a solution: Just increase the value of $Log::Log4perl::caller_depth (defaults to 0) by one for every wrapper that's in between your application and "Log::Log4perl", then "Log::Log4perl" will compensate for the difference.
todd.e.rinaldo wrote: > Hi, > > I often have a helper routine in my code that logs an event and then > does stuff. In some cases, it would be helpful if the line number that > is logged was one level up from where I call debug. > > My question: does functionality exist in l4p similar to Test::More > that would allow me to log events from higher in the stack than where > I called debug? > > Test::More method: > local $Test::Builder::Level++; > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > log4perl-devel mailing list > log4perl-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/log4perl-devel ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ log4perl-devel mailing list log4perl-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/log4perl-devel