vperyod/errorlog-handler

PSR7/PSR3 Exception logging middleware

0.1.0 2016-06-20 16:43 UTC

This package is auto-updated.

Last update: 2024-03-29 02:39:32 UTC


README

Log exceptions to Psr\Log

Latest version Build Status Coverage Status Quality Score

Installation

composer require vperyod/errorlog-handler

Usage

See Psr\Log documentation.

// Create handler with a Logger instance
$handler = new Vperyod\ErrorlogHandler\ErrorlogHandler($logger);

// Optionally set the level to log (default:alert)
$handler->setLogLevel(LogLevel::ERROR);

// Optionally disable rethrowing if there are no other handlers for errors
$handler->setReThrow(false);

// Add to your middleware stack, radar, relay, etc.
$stack->middleware($handler);