[Catalyst] Populate Log4perl config from Catalyst perl hooks

Charlie Garrison garrison at zeta.org.au
Mon Apr 22 11:25:38 GMT 2013


Good evening,

On 22/04/13 at 10:25 AM -0000, Anthony Gladdish 
<anthony.gladdish at newcastle.ac.uk> wrote:

>Then in my Log4perl config:
>
>log4perl.appender.LOGFILE.layout.ConversionPattern=\sub { return MyApp::Cat::my_test_hook(); }
>
>Unfortunately, this only prints " \sub { return MyApp::Cat::my_test_hook(); } " in my log file!
>
>Can anyone see how I may be able to fix this?

I don't think you want the escape (backslash); use this instead:

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

Or maybe this:

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


Charlie

-- 
    Ꮚ Charlie Garrison ♊ <garrison at zeta.org.au>

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt




More information about the Catalyst mailing list