I'm missing something really obvious.
How can I make monolog record all php errors, php user errors, and exceptions?
Before using monolog, I wrote my own functions which I passed to set_error_handler()
, register_shutdown_function()
and set_exception_handler()
. Is there a way of doing this using Monolog's API, or do I have to the following?
Logger::addError(...)
using a switch statement or similarSurely there must be a Monolog API that does the above in a single call?
From the ErrorHandler
class docs:
use Monolog\ErrorHandler;
$logger = new Logger('Logger Name');
ErrorHandler::register($logger);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With