[Catalyst] Best Practices : Logging

Jon jonfdaily at wetxt.com
Mon Nov 16 22:47:44 GMT 2009

I'm building a new Catalyst app, and am trying to follow the best
practices.  What do people typically do for logging in their Model

I would like to have something like,

package App::Model::SomeModel;
use strict;
use warnings;
use parent 'Catalyst::Model::Adaptor';

    class => 'App::Logic::SomeModel',

package App::SomeModel;
use Moose;

has 'log' => (is => 'ro', isa => 'Catalyst::Plugin::Log::Handler',
lazy_build => 1);


sub _build_log {
   my ($self) = @_;

But I don't want to have to manually pass configuration details to it
each time.  There is probably a more standard way to take care of this
that I'm just not aware of.  Can I set it up automatically in my
adaptor class?

- Jon

More information about the Catalyst mailing list