
FirePHP::Log4perl::Appender

In your Log::Log4perl config:
log4perl.rootLogger = DEBUG, FIREPHP log4perl.appender.FIREPHP = FirePHP::Appender log4perl.appender.FIREPHP.layout = FirePHP::Layout log4perl.appender.FIREPHP.layout.ConversionPattern = [ %c ] %m
In the dispatcher of your application:
my $appender = first { $_->isa( 'FirePHP::Log4perl::Appender' ) }
map{ $_->{appender} } values %{ Log::Log4perl->appenders() };
local $appender->{fire_php} =
FirePHP::Dispatcher->new( $your_http_headers_compatile_object );
# the normal dispatch stuff
$appender->fire_php->finalize;

This is a very simple appender for writing to a FirePHP console. Nontheless it is not easy to use because of scoping and threading issues because Log::Log4perl normally just provides an application wide appender object that has no access whatsoever to the HTTP::Headers object of the current object. Your best bet is to use a plugin that is spezialised for your framework.

This creates a new, unassociated appender object. Most of the time you do not want to bind to a FirePHP::Dispatcher object during creation but directly set (and un-set) it in the appropriate time during your application life-cycle.
Returns: a new FirePHP::Log4perl::Appender object
Returns: the associated FirePHP::Dispatcher or undef if the appender is not bound to one
Used by Log::Log4perl::Appender to send messages to the FirePHP console

http://www.firephp.org, Log::Log4perl, FirePHP::Catalyst::Plugin

Sebastian Willert, willert@cpan.org

Copyright 2009 by Sebastian Willert <willert@cpan.org>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.