Skip to content

Cannot use the NullHandler with XML configuration #133

Open
@v1nc3n4

Description

@v1nc3n4

Hi,

I'm working on a Symfony 2 application, and I'd like to temporary disable logging.
I found that adding the NullHandler on top of the configured handlers shall do the job.
Here's my monolog XML configuration:

<monolog:config>
    <monolog:handler name="null_handler" type="null" />
    <monolog:handler name="file_handler" type="stream" level="info" path="%kernel.logs_dir%/%kernel.environment%.log" />
</monolog:config>

However, when I access a web page, this error occured:

InvalidArgumentException in MonologExtension.php line 611:
Invalid handler type "" given for handler "null_handler"

It seems the null type in the XML parameter is treated as a blank string, and I guess there may be an issue in the Configuration class of the bundle.
What is your opinion?

Thanks for your help,
BR

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