Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Error and exception handlers doesn't call a previous handler #3

Closed
weierophinney opened this issue Dec 31, 2019 · 1 comment
Closed

Comments

@weierophinney
Copy link
Member

The previously defined error and exception handlers (if any) will be lost:
https://github.com/zendframework/zend-log/blob/master/src/Logger.php#L562
https://github.com/zendframework/zend-log/blob/master/src/Logger.php#L611

error_reporting(E_ALL);

set_error_handler(function () {
    // We will never get here :-(
    echo 'Previous error handler';
    return true;
});

$logger = new \Zend\Log\Logger([
    'exceptionhandler' => true,
    'errorhandler' => true,
    'writers' => [
        [
            'name' => 'Stream',
            'options' => [
                'stream' => './data/logs/' . date('Y-m-d') . '.log',
            ],
        ],
    ],
]);

trigger_error('Error', E_USER_ERROR);

Originally posted by @27cm at zendframework/zend-log#60

@weierophinney
Copy link
Member Author

This package is considered feature-complete, and is now in security-only maintenance mode, following a decision by the Technical Steering Committee.
If you have a security issue, please follow our security reporting guidelines.
If you wish to take on the role of maintainer, please nominate yourself

If you are looking for an actively maintained package alternative, we recommend:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant