stackify / stackify-log-monolog

Apache License 2.0
3 stars 6 forks source link

log level filtering using settings #4

Closed eberhm closed 4 years ago

eberhm commented 8 years ago

Hi,

I've been trying to setup the stackify/monolog handler to level:warning with no luck. I've only been possible to make it by changing the implementation of the Stackify\Log\Monolog\Handler class and adding the log level in the constructor service definition.

in config.yml

`

services:

stackify_handler:

    class: "Stackify\\Log\\Monolog\\Handler"

    arguments: ["my-app", null, null, WARNING]

`

in Stackify/Log/Monolog/Handler

`

public function handle(array $record)

{

    if ($this->isHandling($record)) {

        $logEntry = new LogEntry($record);

        $this->transport->addEntry($logEntry);

    }

}

`

Thanks in advance

ljthomas commented 8 years ago

Eber,

Thank you for using Stackify! I'd like to get some more information about the environment you're using. I'm going to assume you're using Symfony. If so, can you tell me the version you're using? If not, can you please let me know the framework you're trying to use the Stackify Mono Logger within or any other environment information you're able to share.

Thank you,

Lucas Thomas

eberhm commented 8 years ago

Hi Lucas,

yes, we're using Symfony 2. In the Monolog config we have:

monolog:
    handlers:
        stackify:
            type: service
            id: stackify_handler
#           level: WARNING

We'd love to be capable of configuring the log level in the monolog > handlers > stackify section.

Thanks!

ljthomas commented 8 years ago

Eber,

Thanks for the update! We will look into the issue regarding the Stackify logging level.

Thank you,

Lucas Thomas

eberhm commented 8 years ago

You're welcome. For now I'm just using a wrapper of my own. But I'd love to get rid of it and use directly yours.

Regards