Plack::Middleware::Debug::Log4perl
Plack debug panel to show detailed Log4perl debug messages.
use Plack::Builder; use Plack::Middleware::Debug::Log4perl; builder { enable 'Debug', panels => [qw/Memory Timer Log4perl/]; enable 'Log4perl', category => 'plack', conf => \$log4perl_conf; $app; };
This module provides a plack debug panel that displays the Log4perl messages for the current HTTP request.
Ideally configure Log4perl using Plack::Midleware::Log4perl, or directly in your .psgi file. This way we can hook into the root logger at run time and create the required stealth logger automatically. If you're able to do this, you can skip the next bit.
For applications that configure / init their own logger, you must create a Log4perl appender using TestBuffer, named 'log4perl_debug_panel'.
In your Log4perl.conf:
log4perl.rootLogger = TRACE, DebugPanel log4perl.appender.DebugPanel = Log::Log4perl::Appender::TestBuffer log4perl.appender.DebugPanel.name = psgi_debug_panel log4perl.appender.DebugPanel.mode = append log4perl.appender.DebugPanel.layout = PatternLayout log4perl.appender.DebugPanel.layout.ConversionPattern = %r >> %p >> %m >> %c >> at %F line %L%n log4perl.appender.DebugPanel.Threshold = TRACE
Log4perl: Log::Log4perl
Plack Debug Panel: Plack::Middleware::Debug
Source Repository: https://github.com/miketonks/Plack-Middleware-Debug-Log4perl
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Plack::Middleware::Debug::Log4perl, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::Debug::Log4perl
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::Debug::Log4perl
For more information on module installation, please visit the detailed CPAN module installation guide.