5

I want to log only the deprecated warnings to a new file. But I can't see how to achieve that with monolog. Is there a custom configuration?

Thanks in advance!

1 Answers1

5

All Deprecated Message are logged As INFO level, php Channels so if You try this configuration All deprecation message will be logged in one file

monolog:
    handlers:
        security:
            level:    INFO
            type:     stream
            path:     '%kernel.logs_dir%/deprecated.log'
            channels: [php]
Barkati.med
  • 620
  • 5
  • 11
  • Works like a charm. I will try the same on production. – Rodrigo Santellan Jun 12 '17 at 14:30
  • 1
    This will catch *all* messages in the `php` channel, not only the deprecations. For example, this will also include uncaught exceptions during the rendering of a twig template. – Maurice Dec 18 '19 at 13:57