Skip to content

Impossible to disable user deprecated errors #17592

@NikitaObukhov

Description

@NikitaObukhov

Symfony: symfony/framework-bundle v5.4.14| v6.1.7
symfony/error-handler v5.4.15| v6.1.7

Same is with latest 5 and 6 versions. There is no docs of how to disable these useless messages which make impossible to use this framework.

The whole output is messed with hundreds of "[info] User Deprecated:" errors. Impossible to use bin/console - hunderds of deprecation messages. Each request takes multiple seconds because of very slow error handling.

I tried according to stackoverflow (no docs regarding this. You can try "disable deprecated warning site:symfony.com" - no results):
framework.yaml
php_errors:
log: false

I tried:
error_reporting(0) - does not work

Actually nothing works. Lots of issues - no solution.

symfony/symfony#35575 (comment)

The only working way to handle is to override boot method of App\Kernel:

    public function boot()
    {
        parent::boot();
        ErrorHandler::register(null, false)->setLoggers([
            \E_DEPRECATED => [null],
            \E_USER_DEPRECATED => [null],
        ]);
    }

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