[Catalyst] Populate Log4perl config from Catalyst perl hooks

Anthony Gladdish anthony.gladdish at newcastle.ac.uk
Tue Apr 23 08:36:57 GMT 2013

Hi Charlie,

>-----Original Message-----
>From: Charlie Garrison [mailto:garrison at zeta.org.au]
>Sent: 22 April 2013 17:56
>To: The elegant MVC web framework
>Subject: RE: [Catalyst] Populate Log4perl config from Catalyst
>perl hooks
>Good morning,
>On 22/04/13 at 3:57 PM -0000, Anthony Gladdish
><anthony.gladdish at newcastle.ac.uk> wrote:
>>It's turned on by default, yet enabling/disabling it before
>>initialising the new log object, doesn't appear to fix:
>I don't know what else to suggest. This is an (slightly
>modified) example that works for us:
>log4perl.appender.CLIENTLOG.filename=sub { require MyApp;
>MyApp->path_to('client.log'); }

This has worked, thanks for your help.

I changed:

	log4perl.appender.LOGFILE.layout.ConversionPattern=\sub { return MyApp::Cat::my_test_hook(); }


	log4perl.appender.LOGFILE.layout.ConversionPattern=sub { return MyApp::Cat->my_test_hook(); }

... removing the "\" and converting "::" to "->".

The documentation says to use "\sub" - not sure if this is an issue with their documentation. I'll get in contact with the author.

Many thanks,

More information about the Catalyst mailing list