Sebastian Willert > FirePHP-Dispatcher-0.02_01 > FirePHP::Log4perl::Appender

Download:
FirePHP-Dispatcher-0.02_01.tar.gz

Dependencies

Annotate this POD

Source  

NAME ^

FirePHP::Log4perl::Appender

SYNOPSIS ^

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;

DESCRIPTION ^

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.

METHODS ^

$class->new( %options )

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

$self->fire_php

Returns: the associated FirePHP::Dispatcher or undef if the appender is not bound to one

$self->log( %params )

Used by Log::Log4perl::Appender to send messages to the FirePHP console

SEE ALSO ^

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

AUTHOR ^

Sebastian Willert, willert@cpan.org

COPYRIGHT AND LICENSE ^

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.

syntax highlighting: