Monday, January 3, 2011

Enable Frontend Logging in Production Environment in Symfony

  1. Enable logging in frontend/config/settings.yml.
    logging_enabled: true
  2. Change the code below in the prod section of the factories.yml:
      logger:
        class:   sfNoLogger
        param:
          level:   err
          loggers: ~
    
    with this:
      logger:
        class: sfAggregateLogger
        param:
          level: debug
          loggers:
            sf_web_debug:
              class: sfWebDebugLogger
              param:
                level: debug
                condition:       %SF_WEB_DEBUG%
                xdebug_logging:  true
                web_debug_class: sfWebDebug
            sf_file_debug:
              class: sfFileLogger
              param:
                level: debug
                file: %SF_LOG_DIR%/%SF_APP%_%SF_ENVIRONMENT%.log
    

2 comments: