Earlier this month, I've read about this extension: [chromePHP](http://www.chromephp.com/). The principle of this extension is to allow you to log from your PHP application to chrome. You may not be aware, but this is something you already have with every web application if you're using Plack. And not only for Chrome, but every webkit navigator, and Firefox too! Let's mimic their page. ## Installation 1. install [Plack::Middleware::ConsoleLogger](http://search.cpan.org/perldoc?Plack::Middleware::ConsoleLogger) with `cpanm Plack::Middleware::ConsoleLogger` 2. no step 2 3. no step 3 4. write a simple PSGI application and log ``` perl use strict; use warnings; use Plack::Builder; my $app = sub { my $env = shift; my $content = "
this is foo"; foreach my $k ( keys %$env ) { if ( $k =~ /HTTP_/ ) { $env->{'psgix.logger'}->({ level => 'debug', message => "$k => " . $env->{$k}, }); } } $env->{'psgix.logger'}->({ level => 'warn', message => 'this is a warning', }); $env->{'psgix.logger'}->({ level => 'error', message => 'this is an error', }); return [ 200, [ 'Content-Type' => 'text/html' ], [$content] ]; }; builder { enable "ConsoleLogger"; $app; } ``` Load this application with plackup: `plackup chromeplack.pl` point your browser to