[Catalyst] How to enhance Log4Perl log-files about the loggend in user ($c->user->id)?

Tomas Doran bobtfish at bobtfish.net
Thu Jul 23 17:11:02 GMT 2009

Jon Schutz wrote:
> Somewhere early on on the request cycle do
> Log::Log4perl::MDC->put( 'user' => $user );
> then insert it into your log messages via your Log4perl configuration
> such as:
> log4perl.appender.Logfile.layout.ConversionPattern: "%d %-5p %c -
> USER:%X{user} - %m%n"

Doc patches on Catalyst::Log::Log4perl showing how to do this would be 
very welcome.



More information about the Catalyst mailing list