Plack::Middleware::LogAny(3pm)

Plack::Middleware::LogAny3pm

Use log::any to handle logging from your psgi application

Usage

  # in app.psgi file
  use Plack::Builder;
  # PSGI application
  my $app = sub { ... };
  # DSL interface
  builder {
    enable 'LogAny', category => 'plack', context => [ qw( X-Request-ID ) ];
    $app;
  }
  # alternative OO interface
  Plack::Middleware::LogAny->wrap( $app, category => 'plack', context => [ qw( X-Request-ID ) ] );

Overview

LogAny is a Plack::Middleware component that allows you to use Log::Any to handle the "psgix.logger" logging object. This object is a code reference that is described in PSGI::Extensions.

Methods

prepare_app()

This method initializes the logger using the category that you (optionally) set.

call()

This method sets the logging object and the logging context. The logging context is localized.

Options

category

The "Log::Any" category to send logs to. Defaults to '' which means it send to the root logger.

context

As of release 0.002.

A list of HTTP header names that is passed from the PSGI environment to the "Log::Any" logging context.

Releases

5 releases since Debian 9 (Stretch); the text changed 3 times.

  1. 9–10
  2. 11
  3. 12
  4. 13

Author

Sven Willenbuecher <[email protected]>

From libplack-middleware-logany-perl 0.002.001-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.