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

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

@anton-kotik

Description

@anton-kotik

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions