>-----Original Message----- >From: Charlie Garrison [mailto:garri...@zeta.org.au] >Sent: 22 April 2013 12:26 >To: The elegant MVC web framework >Subject: Re: [Catalyst] Populate Log4perl config from Catalyst >perl hooks > >Good evening, > >On 22/04/13 at 10:25 AM -0000, Anthony Gladdish ><anthony.gladd...@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(); }
No, neither removing the backslash or adding the require statement has worked. Anthony
_______________________________________________ List: Catalyst@lists.scsys.co.uk Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/ Dev site: http://dev.catalyst.perl.org/