php - Monolog: how to catch all errors and exceptions -
i'm missing obvious.
how can make monolog record php errors, php user errors, , exceptions?
before using monolog, wrote own functions passed set_error_handler()
, register_shutdown_function()
, set_exception_handler()
. there way of doing using monolog's api, or have following?
- write error handler , exception handler pass php's functions above
- in handlers, call appropriate monolog functions such
logger::adderror(...)
using switch statement or similar
surely there must monolog api above in single call?
old question since not yet answered - errorhandler you're after.
from the documentation:
errorhandler:
monolog\errorhandler
class allows register logger instance exception handler, error handler or fatal error handler.
Comments
Post a Comment