Giter VIP home page Giter VIP logo

plack-middleware-timed-logger's Introduction

NAME

Plack::Middleware::Timed::Logger - Expose a Timed::Logger Instance in Middleware

VERSION

Version 0.0.5

SYNOPSIS

use Plack::Builder;
builder {
  enable 'Timed::Logger';
  $app;
};

DESCRIPTION

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.

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.

SUBROUTINES

This middleware defines the following public subroutines

PSGI_KEY

Returns the PSGI $env key under which you'd expect to find an instance of Timed::Logger.

get_logger_from_env

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.

call

An callback used by Plack to call this middleware.

SEE ALSO

Timed::Logger, Plack::Middleware::Debug::Timed::Logger, Timed::Logger::Dancer::AdoptPlack

AUTHOR

Nikolay Martynov, <kolya at cpan.org>

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Plack::Middleware::Timed::Logger

You can also look for information at:

ACKNOWLEDGEMENTS

Logan Bell and Belden Lyman.

LICENSE AND COPYRIGHT

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.

plack-middleware-timed-logger's People

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.