chaplean / ovh-logs-bundle

This bundle adds support for sending your logs to OVH's graylog endpoint.
MIT License
0 stars 1 forks source link

Use as a fingers_crossed nested handler #2

Open drzraf opened 4 years ago

drzraf commented 4 years ago

I'm currently trying the following:


monolog:
    handlers:
        ovh:
            type: fingers_crossed
            action_level: debug
            handler: ovh_raw
            excluded_http_codes: [404, 405]
        ovh_raw:
            type: gelf
            publisher:
                id: gelf.publisher
            level: debug
 ```

In order to ignore 404 from Graylog. Does not seem to work ("Route not found" errors still flowing down Graylog). Any idea why so?
mdevlamynck commented 4 years ago

Do you have the same issue if you try using an other logger type like stream or console in ovh_raw?

This bundle adds a token for ovh on each log (https://github.com/chaplean/ovh-logs-bundle/blob/master/Processor/OvhLogsProcessor.php#L37). It will add this token on the handler called ovh. Maybe that handler needs to be the gelf handler. So maybe try renaming the handler ovh to something like ovh_filter and ovh_raw to ovh.