Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable "notified event" message from DEBUG log

It's a painfull job to analyse my actual dev log because the huge amount of "event.DEBUG: Notified event ..." messages. Anyone knows how can I disable the dispatcher notification logs?

Thanks in advance!

like image 693
Hugo Nogueira Avatar asked May 17 '13 03:05

Hugo Nogueira


2 Answers

You can use channels to ignore events.

  monolog:
      handlers:
          main:
              type:  stream
              path:  "%kernel.logs_dir%/%kernel.environment%.log"
              level: debug
              channels: "!event"

see details here : http://symfony.com/doc/current/cookbook/logging/channels_handlers.html#yaml-specification

like image 193
krichprollsch Avatar answered Oct 16 '22 12:10

krichprollsch


The easiest way to accomplish all of this is splitting the various logging channels and levels in app/config/config_dev.yml

monolog:
  handlers:
    event_all:
      bubble: false
      action_level: DEBUG
      type:  stream
      path:  %kernel.logs_dir%/%kernel.environment%_event_all.log
      channels: event
    event_errors:
      action_level: ERROR
      type:  stream
      path:  %kernel.logs_dir%/%kernel.environment%_event_errors.log
      channels: event
    main:
      type:  stream
      path:  %kernel.logs_dir%/%kernel.environment%.log
      level: DEBUG  

Best guide for how to separate different channels and error levels is here: http://symfony.com/doc/current/cookbook/logging/monolog.html

Also, see here for my personal recommendations for production log separation: Symfony2 - Doctrine log

like image 42
AJ Cerqueti Avatar answered Oct 16 '22 12:10

AJ Cerqueti