[Catalyst] Multiple instances of same app with 5.80 under mod_perl

Tomas Doran bobtfish at bobtfish.net
Thu May 28 17:05:34 GMT 2009


Matthias Dietrich wrote:
> do you use Log::Log4perl in your Catalyst apps?  Months ago I wrote a 
> message to the list about problems with Log::Log4perl and multiple 
> instances of Catalyst within one Apache.  Nobody answered and because 
> it's currently not very important to me (not in production environment 
> yet) I didn't follow-up.
> 
> The problem was to separate each VirtualHosts Catalyst into different 
> log files which didn't worked.  Catalyst always logged into the file 
> from the latest VirtualHost.  Maybe I have some short time tomorrow to 
> create a local test case (I use the included server now so I have to 
> switch to Apache again).

This is to be expected.

The instance of the logging class to use is stored in class data inside 
your application class.

One solution to this would be to keep a hash of log class instances per 
vhost, and then ensure to replace the logger being used at the start of 
each hit - this should do what you're looking for..

Cheers
t0m




More information about the Catalyst mailing list