Overview

dot-errorhandler is Dotkernel's PSR-15 error handler middleware, with optional logging through any PSR-3 logger.

Version History

Branch Release PSR-11 Log Style Implementation OSS Lifecycle PHP Version
6.0 >= 6.0 1, 2 PSR-Log (any logger) OSS Lifecycle PHP from Packagist (specify version)
5.0 >= 5.0 2 PSR-Log OSS Lifecycle PHP from Packagist (specify version)
4.1 >= 4.2 2 PSR-Log OSS Lifecycle PHP from Packagist (specify version)
4.1 < 4.2 2 Laminas Log OSS Lifecycle PHP from Packagist (specify version)
4.0 < 4.1 1 Laminas Log OSS Lifecycle PHP from Packagist (specify version)
3.0 < 4.0 1 Laminas Log OSS Lifecycle PHP from Packagist (specify version)

Badges

OSS Lifecycle PHP from Packagist (specify version)

GitHub issues GitHub forks GitHub stars GitHub license

Build Static codecov PHPStan

Features

This package provides two middleware classes:

  • Dot\ErrorHandler\ErrorHandler, the same as Laminas Stratigility's ErrorHandler middleware, which is marked @final, but open for extension
  • Dot\ErrorHandler\LogErrorHandler, which extends ErrorHandler and logs every error through a PSR-3 logger, optionally with extra request data

Version 6 works with any PSR-11 container, any PSR-3 logger and any PSR-15 middleware pipeline. It no longer installs dotkernel/dot-log for you, and it no longer requires laminas/laminas-diactoros directly; see Installation.

Upgrading from an earlier version? Read Upgrading.