NAME

Plack::Middleware::OIDC::Logger - Minimal default logger for Plack::Middleware::OIDC

DESCRIPTION

OIDC::Client and OIDC::Client::Plugin require a logger object that implements the debug, info, error and (warning or warn) methods (see OIDC::Client::Role::LoggerWrapper).

Unlike Mojolicious, Catalyst or Dancer2, Plack does not provide a logger out of the box, so this small class is used by default, writing to STDERR (or to $env-{'psgix.logger'}> if available). You can provide your own logger object instead via the log option of Plack::Middleware::OIDC, as long as it implements the same interface.

METHODS

new( %args )

Optional env argument: if given and $env-{'psgix.logger'}> is set, messages are sent there instead of STDERR.

set_env($env)

Sets the PSGI environment attribute.

The environment is used to access the psgix.logger callback, when available, so that log messages can be forwarded to the logging mechanism provided by the PSGI application server.

debug($message)

Logs a message at the debug level.

info($message)

Logs a message at the info level.

warning($message)

Logs a message at the warn level.

warn($message)

Logs a message at the warn level.

error($message)

Logs a message at the error level.