[Catalyst] Multiple Files With Catalyst::Log::Log4perl

Asim Jalis asimjalis at gmail.com
Wed Mar 23 16:19:28 GMT 2011


I need Catalyst::Log::Log4perl to produce multiple log files. I have a
Catalyst application that runs batch scripts and needs to generate a
separate log file for each script.

Ideally, I'd like to change the log file name dynamically within a
Catalyst controller each time it's called.

Using a sub{} on filename in the config only runs the sub{} the first
time it loads up the conf -- it doesn't run it after that, so it
doesn't quite work.

   log4perl.appender.Logfile = Log::Log4perl::Appender::File
   log4perl.appender.Logfile.filename = sub { return get_log_file(); }

Any ideas?

Thanks!

Asim



More information about the Catalyst mailing list