I'm using  MooseX::Log4perl together with MooseX::Traits::Pluggable.
Since the latter builds an __ANON__ class, the Log4perl default category assignment doesn't work as it iuses ref ($self).

So I tried to add the line

has '+logger' => (default => sub { my $self = shift; return Log::Log4perl::get_logger($self->_original_class_name) });

in my class,  yet this code  is never executed!
When I use $self->log('myCategory')->debug(...) it works, but I would prefer to use $self->logger>debug(...)

The strange thing is, I've written some small classes for debugging this problem and there it works, so I have no idea whats going wrong here.
Any ideas what  the problem could be ?


Rolf Schaufelberger




Reply via email to