{"id":19007368,"url":"https://github.com/mar-kolya/plack-middleware-timed-logger","last_synced_at":"2026-06-18T01:31:32.435Z","repository":{"id":10705703,"uuid":"12951722","full_name":"mar-kolya/Plack-Middleware-Timed-Logger","owner":"mar-kolya","description":null,"archived":false,"fork":false,"pushed_at":"2013-10-03T04:16:46.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-21T14:33:53.031Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mar-kolya.png","metadata":{"files":{"readme":"README.pod","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-19T15:14:13.000Z","updated_at":"2014-09-09T14:48:37.000Z","dependencies_parsed_at":"2022-09-22T21:42:07.724Z","dependency_job_id":null,"html_url":"https://github.com/mar-kolya/Plack-Middleware-Timed-Logger","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/mar-kolya/Plack-Middleware-Timed-Logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar-kolya%2FPlack-Middleware-Timed-Logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar-kolya%2FPlack-Middleware-Timed-Logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar-kolya%2FPlack-Middleware-Timed-Logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar-kolya%2FPlack-Middleware-Timed-Logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mar-kolya","download_url":"https://codeload.github.com/mar-kolya/Plack-Middleware-Timed-Logger/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mar-kolya%2FPlack-Middleware-Timed-Logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34472822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T18:37:08.789Z","updated_at":"2026-06-18T01:31:32.421Z","avatar_url":"https://github.com/mar-kolya.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"package Plack::Middleware::Timed::Logger;\n\nuse 5.16.0;\nuse strict;\nuse warnings;\n\nuse parent qw(Plack::Middleware);\nuse Timed::Logger;\n\n=head1 NAME\n\nPlack::Middleware::Timed::Logger - Expose a Timed::Logger Instance in Middleware\n\n=head1 VERSION\n\nVersion 0.0.5\n\n=cut\n\nour $VERSION = '0.0.5';\n\n=head1 SYNOPSIS\n\n    use Plack::Builder;\n    builder {\n      enable 'Timed::Logger';\n      $app;\n    };\n\n=head1 DESCRIPTION\n\nL\u003cPlack::Middleware::Timed::Logger\u003e does one thing, it places an instance of\nL\u003cTimed::Logger\u003e into the C\u003c$env\u003e under C\u003cplack.middleware.timed.logger\u003e.\nA new instance is created for each incoming request.\n\nThis middleware is intended to act as a bridge between L\u003cTimed::Logger\u003e, which\nholds log of the events, with a reporting tool such as seen in\nL\u003cPlack::Middleware::Debug::Timed::Logger\u003e.\n\nUnless you are building some custom logging tools, you probably just want to\nuse the existing debug panel (L\u003cPlack::Middleware::Debug::Timed::Logger\u003e)\nrather than building something custom around this middleware.\n\nIf you are using Dancer to build your web application you may want to use\nL\u003cTimed::Logger::Dancer::AdoptPlack\u003e to help you to bridge Dancer's conrollers\nwith this middleware.\n\nThis module was inspired by L\u003cPlack::Middleware::DBIC::QueryLog\u003e.\n\n=head1 SUBROUTINES\n\nThis middleware defines the following public subroutines\n\n=head2 PSGI_KEY\n\nReturns the PSGI C\u003c$env\u003e key under which you'd expect to find an instance of\nL\u003cTimed::Logger\u003e.\n\n=head2 get_logger_from_env\n\nGiven a L\u003cPlack\u003e C\u003c$env\u003e, returns a L\u003cTimed::Logger\u003e.\nYou should use this in your code that is trying to access the logger. For\nexample:\n\n    use Plack::Middleware::Timed::Logger;\n\n    sub logger {\n      my ($self, $env) = @_;\n      Plack::Middleware::Timed::Logger-\u003eget_logger_from_env($env);\n    }\n\nThis function creates a new instance of L\u003cTimed::Logger\u003e if one doesn't exist already.\nThis is the officially supported interface for extracting a L\u003cTimed::Logger\u003e from a L\u003cPlack\u003e request.\n\n=head2 call\n\nAn callback used by Plack to call this middleware.\n\n=cut\n\nsub PSGI_KEY {'plack.middleware.timed.logger'}\n\nsub get_logger_from_env {\n  my ($self, $env) = @_;\n  #Create a new logger if one is not defined already\n  $env-\u003e{+PSGI_KEY} ||= Timed::Logger-\u003enew();\n  return $env-\u003e{+PSGI_KEY};\n}\n\nsub call {\n  my ($self, $env) = @_;\n  $env-\u003e{+PSGI_KEY} ||= Timed::Logger-\u003enew();\n  $self-\u003eapp-\u003e($env);\n}\n\n=head1 SEE ALSO\n\nL\u003cTimed::Logger\u003e, L\u003cPlack::Middleware::Debug::Timed::Logger\u003e,\nL\u003cTimed::Logger::Dancer::AdoptPlack\u003e\n\n=head1 AUTHOR\n\nNikolay Martynov, C\u003c\u003c \u003ckolya at cpan.org\u003e \u003e\u003e\n\n=head1 BUGS\n\nPlease report any bugs or feature requests to C\u003cbug-plack-middleware-timed-logger at rt.cpan.org\u003e, or through\nthe web interface at L\u003chttp://rt.cpan.org/NoAuth/ReportBug.html?Queue=Plack-Middleware-Timed-Logger\u003e.\nI will be notified, and then you'll automatically be notified of progress on your bug as I make changes.\n\n=head1 SUPPORT\n\nYou can find documentation for this module with the perldoc command.\n\n    perldoc Plack::Middleware::Timed::Logger\n\n\nYou can also look for information at:\n\n=over 4\n\n=item * RT: CPAN's request tracker (report bugs here)\n\nL\u003chttp://rt.cpan.org/NoAuth/Bugs.html?Dist=Plack-Middleware-Timed-Logger\u003e\n\n=item * AnnoCPAN: Annotated CPAN documentation\n\nL\u003chttp://annocpan.org/dist/Plack-Middleware-Timed-Logger\u003e\n\n=item * CPAN Ratings\n\nL\u003chttp://cpanratings.perl.org/d/Plack-Middleware-Timed-Logger\u003e\n\n=item * Search CPAN\n\nL\u003chttp://search.cpan.org/dist/Plack-Middleware-Timed-Logger/\u003e\n\n=back\n\n\n=head1 ACKNOWLEDGEMENTS\n\nLogan Bell and Belden Lyman.\n\n=head1 LICENSE AND COPYRIGHT\n\nCopyright 2013 Nikolay Martynov and Shutterstock Inc (http://shutterstock.com). All rights reserved.\n\nThis program is free software; you can redistribute it and/or modify it\nunder the terms of either: the GNU General Public License as published\nby the Free Software Foundation; or the Artistic License.\n\nSee L\u003chttp://dev.perl.org/licenses/\u003e for more information.\n\n=cut\n\n1; # End of Plack::Middleware::Timed::Logger\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmar-kolya%2Fplack-middleware-timed-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmar-kolya%2Fplack-middleware-timed-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmar-kolya%2Fplack-middleware-timed-logger/lists"}