[Catalyst] (no subject)

Christian Lackas christian at lackas.net
Fri Jan 9 14:00:28 GMT 2009

Hi Everybody,

I wonder if there is any simple way to always include runtime
information into Catalyst's logging.
In particular, I use Catalyst::Log::Log4perl to log activity of my
application, showing the user that triggered an event, such as:

    $c->log->info("[".$c->user->username."] "."actual message");

and would like to avoid having to manually include the username in every
Is it somehow possible to have Catalyst or Log4perl include the 


part automatically?

I already found (which I set in MyApp.pm)

        sub { return "xxx"; }

which adds a '%U' to the output pattern. However, I see no way to give
the closure the instance of the currently running MyApp (so I can assess
the user() method).

How do you handle situations like this?

Best regards,

More information about the Catalyst mailing list