Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

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

Open
anton-kotik opened this issue Sep 17, 2016 · 1 comment
Open

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

anton-kotik opened this issue Sep 17, 2016 · 1 comment

Comments

@anton-kotik
Copy link

anton-kotik commented Sep 17, 2016

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);
@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-log; a new issue has been opened at laminas/laminas-log#3.

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

2 participants