laiguPHPLoggerPlugin - 1.0.1

System to handle PHP errors and excepcions and send them to Symfony log system.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

laiguPHPLogger plugin

Overview

laiguPHPLoggerPlugin provides a system to handle PHP errors and excepcions and send them to Symfony log system.

Installation

  • Download and install the plugin

    ./symfony plugin:install laiguPHPLoggerPlugin
    
  • Clear the cache

    ./symfony cc
    

Configuration

  • Enable the plugin laiguPHPLoggerPlugin on a project, via /config/ProjectConfiguration.class.php:

      class ProjectConfiguration extends sfProjectConfiguration
      {
        public function setup()
        {
          $this->enablePlugins('sfDoctrinePlugin', 'laiguPHPLoggerPlugin');
        }
      }
    
  • Edit your application factories.yml file: /apps//config/factories.yml and configure your logger:

      all:
        logger:
          class: sfAggregateLogger
          param:
            level: warning
            loggers:
              laigu_php_logger:
                class: laiguPHPLogger
                param:
                  php_level: <?php echo ((E_ALL | E_STRICT) ^ E_NOTICE)."\n" ?> # set error level to handle
                  exception: true # enable exception handler
              # these following lines are optionals. Sf errors, php errors and excepcions are sended to a file and to the console
              sf_file_log:
                class: sfFileLogger
                param:
                  level: warning
                  file: /tmp/%SF_APP%_%SF_ENVIRONMENT%.log
              sf_console:
                class: sfConsoleLogger
                param:
                  level: warning
    

That's it!.

Contact

  • Jordi Llonch ( jordi [at] laigu [dot] net ), [http://www.laigu.net]

Changelog

  • version 1.0.0: initial release