Errorhandling extension for PSR-3 compatible loggers 2018-06-26 15:34 UTC


Scrutinizer Code Quality Build Status Latest Stable Version License

Errorhandling extension for PSR-3 compatible loggers

Why should I care?

ErrorHandling helps you getting every type of problem in your logging-channels.

How does it work?

ErrorHandling uses most of PHP's capabilities to capture notices, warnings, errors, exceptions and even fatal errors in most situations and redirect them to user-defined PSR-3 compatible logging channels.

Typically you would end up having something like this:

$coreHandlers = new CoreErrorHandlers();
$coreHandlers->registerAssertionHandler($logger, LogLevel::DEBUG);

This will register trigger-callback-functions for asserts, exceptions and fatal errors. It also registers exception-handlers for every notice, warning and error.

Note: You need to run the registration-process on every run. Yes, I think you already got it, but just in case: Any problems only get caught if the registration was already made at the time the problem occurs.