From: Mike S. <m...@pe...> - 2012-11-25 08:02:13
|
On Sun, 4 Nov 2012, dan...@sa... wrote: > I can't see an API for fetching the category of a logger. Is there a > reason for that? Sorry for the long wait on this, somehow your email got stuck in spam quarantaine. You're right, there's currently no accessor for a logger's category, I've added one just now: https://github.com/mschilli/log4perl/commit/67360dc96380a878a267c4f434dd8b6c7d2a4031 To work around the limitation, you can use $logger->{category} till it rolls out with the next release. Thanks for bringing this issue to my attention. -- -- Mike Mike Schilli m...@pe... > > In particular, I'd like to make a "daughter" logger from an existing one. i.e. given > > my $logger = get_logger("com.sadinoff.hello"); > > > . . . > > I'd like to say > > my $subLogger = $logger->get_daughter_logger("foobar") > > ...and have the category be "com.sadinoff.hello.foobar". > > I thought maybe I'd do > > get_logger($logger->getCategory() . ".foobar") > > ..but I don't see anything like either method above. I *could* just > fetch $logger->{category}, but I doubt that would be supported. > > > ——— > Danny Sadinoff > dan...@sa... > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov > _______________________________________________ > log4perl-devel mailing list > log...@li... > https://lists.sourceforge.net/lists/listinfo/log4perl-devel |