[log4perl-devel] Categories - doc/implementation problem ??

2012-11-24 Thread David Pointon
Hi ,

I'm sure I can't be the only one to have tried the my $logger = 
Log::Log4perl->new($class); way of dynamically creating a category as suggested 
here 
(http://search.cpan.org/~mschilli/Log-Log4perl-1.39/lib/Log/Log4perl.pm#Categories)
 but end up with a 'THIS CLASS ISN'T FOR DIRECT USE. PLEASE CHECK...' error.

I only tried this because, having created a root logger with category Foo::Bar, 
all get_logger($class) calls (where $class is in Foo::Bar or a subclass 
thereof) return an Log::Log4perl::Logger object whereas I expected, but could 
not get, a Foo::Bar or Foo::Bar::Logger object. Using category within the 
configuration isn't an option because, on a per-package basis, the composition 
of the categories is not determined 'til run-time and may change even then.

Rgds ,

--
D.C. Pointon FIAP MBCS | Now I saw, tho' too late, the folly of
07810 645299   | beginning a work before we count the cost
01730 233886   | and before we judge rightly of our strength
   | to go thro' with  it. Robinson Crusoe



--
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel


[log4perl-devel] API for fetching the category from a logger?

2012-11-24 Thread danny-log4perl
I can't see an API for fetching the category of a logger.  Is there a reason 
for that?

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
[email protected]

--
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/log4perl-devel