From: Robert J. <yad...@sn...> - 2007-01-12 18:46:24
|
At 12:58 PM 1/12/2007, Mike Schilli m-at-perlmeister.com |log4perl_sourceforge| wrote: >Not sure if I understand correctly, but if you want to know how your >custom appender was used in the L4p configuration file, and specifically >what name has been assigned to it: That's ambiguous, because a certain >type of appender could be used multiple times under different names. That's what I mean exactly. But it seems like maybe I don't need it. I was building my own hash, like %params = ( name => $name, level => 2, log4p_level => 'INFO', message => 'Log message', log4p_category => $category, ); then calling SUPER::log(%params). I thought I couldn't build that hash without $name and $category -- thus the original question. Then I figured I'll just try it without them --and it still works even if "name" isn't the name of a real appender. I guess name and category only need to be correct if you are using them in the layout? (I didn't try it with "incorrect" name and category while having them in the layout...) >But you can always get all used appenders names by calling > > my $appenders = Log::Log4perl->appenders(); Thanks, I saw that -- it lists the appenders, but I don't know which one is currently being called. -- Rob |