Class LoggerConfiguratorPhp

Description

Implements interfaces:

LoggerConfiguratorPhp class

This class allows configuration of log4php through an external file that deliver a PHP array in return.

An example for this configurator is:

  1. require_once dirname(__FILE__).'/../../main/php/Logger.php';
  2.  
  3. Logger::configure(dirname(__FILE__).'/../resources/configurator_php.php''LoggerConfiguratorPhp');
  4. $logger Logger::getRootLogger();
  5. $logger->info("Hello World!");

Which includes the following snippet:

  1. return array(
  2.         'threshold' => 'ALL',
  3.         'rootLogger' => array(
  4.             'level' => 'INFO',
  5.             'appenders' => array('default'),
  6.         ),
  7.         'loggers' => array(
  8.             'dev' => array(
  9.                 'level' => 'DEBUG',
  10.                 'appenders' => array('default'),
  11.             ),
  12.         ),
  13.         'appenders' => array(
  14.             'default' => array(
  15.                 'class' => 'LoggerAppenderEcho',
  16.                 'layout' => array(
  17.                     'class' => 'LoggerLayoutPattern',
  18.                     'conversionPattern' => "%d{Y-m-d H:i:s} %-5p %c %X{username}: %m in %F at %L%n",
  19.                 ),
  20.             ),
  21.         ),
  22.     );

  • since: 2.0

Located in /configurators/LoggerConfiguratorPhp.php (line 39)


	
			
Method Summary
void configure (LoggerHierarchy $hierarchy, [ $url = ''])
Methods
configure (line 41)
  • access: public
void configure (LoggerHierarchy $hierarchy, [ $url = ''])

Implementation of:
LoggerConfigurator::configure()
Interpret a resource pointed by a url and configure accordingly.

Documentation generated on Fri, 27 Nov 2009 07:44:49 +0100 by phpDocumentor 1.4.3