Matthias Dietrich wrote:
Hi,
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..
yes, I thought I have to do it in such a way. Where would be the best
point to get the right logger?
I'm thinking something like this:
{
my %loggers;
after prepare => sub {
my $class = shift;
my $host = $c->req->hoatname
my $logger = $loggers{host} ||= My::Logger->new( logfile =>
$class->path_to('logs', "$host.log") );
$class->log( $logger );
};
}
(untested)
Cheers
t0m
_______________________________________________
List: [email protected]
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/