Hugo Nogueira
Hugo Nogueira

Reputation: 1318

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!

Upvotes: 11

Views: 6700

Answers (2)

krichprollsch
krichprollsch

Reputation: 391

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

Upvotes: 14

AJ Cerqueti
AJ Cerqueti

Reputation: 716

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

Upvotes: 7

Related Questions