Atatus automatically captures exceptions in all major PHP frameworks. But, exceptions will not be captured during single PHP file execution. In order to capture those exceptions, use the set_exception_handler()
function.
Compatibility
Compatible with all PHP agent versions.
Syntax
set_exception_handler($error_handler)
Parameter
Parameter | Type | Description |
---|---|---|
$error_handler | String (Required) | Error handler function name. |
Example
copy
<?php
function exception_handler($ex) {
if (extension_loaded('atatus')) {
atatus_notify_exception($ex);
}
}
set_exception_handler('exception_handler');