Plack::Middleware::Timed::Logger - Expose a Timed::Logger Instance in Middleware
Version 0.0.5
use Plack::Builder; builder { enable 'Timed::Logger'; $app; };
Plack::Middleware::Timed::Logger does one thing, it places an instance of Timed::Logger into the $env under plack.middleware.timed.logger. A new instance is created for each incoming request.
$env
plack.middleware.timed.logger
This middleware is intended to act as a bridge between Timed::Logger, which holds log of the events, with a reporting tool such as seen in Plack::Middleware::Debug::Timed::Logger.
Unless you are building some custom logging tools, you probably just want to use the existing debug panel (Plack::Middleware::Debug::Timed::Logger) rather than building something custom around this middleware.
If you are using Dancer to build your web application you may want to use Timed::Logger::Dancer::AdoptPlack to help you to bridge Dancer's conrollers with this middleware.
This module was inspired by Plack::Middleware::DBIC::QueryLog.
This middleware defines the following public subroutines
Returns the PSGI $env key under which you'd expect to find an instance of Timed::Logger.
Given a Plack $env, returns a Timed::Logger. You should use this in your code that is trying to access the logger. For example:
use Plack::Middleware::Timed::Logger; sub logger { my ($self, $env) = @_; Plack::Middleware::Timed::Logger->get_logger_from_env($env); }
This function creates a new instance of Timed::Logger if one doesn't exist already. This is the officially supported interface for extracting a Timed::Logger from a Plack request.
An callback used by Plack to call this middleware.
Timed::Logger, Plack::Middleware::Debug::Timed::Logger, Timed::Logger::Dancer::AdoptPlack
Nikolay Martynov, <kolya at cpan.org>
<kolya at cpan.org>
Please report any bugs or feature requests to bug-plack-middleware-timed-logger at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Plack-Middleware-Timed-Logger. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-plack-middleware-timed-logger at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Plack::Middleware::Timed::Logger
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Plack-Middleware-Timed-Logger
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Plack-Middleware-Timed-Logger
CPAN Ratings
http://cpanratings.perl.org/d/Plack-Middleware-Timed-Logger
Search CPAN
http://search.cpan.org/dist/Plack-Middleware-Timed-Logger/
Logan Bell and Belden Lyman.
Copyright 2013 Nikolay Martynov and Shutterstock Inc (http://shutterstock.com). All rights reserved.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Plack::Middleware::Timed::Logger, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Plack::Middleware::Timed::Logger
CPAN shell
perl -MCPAN -e shell install Plack::Middleware::Timed::Logger
For more information on module installation, please visit the detailed CPAN module installation guide.