diff --git a/libraries/log4php.debug/Logger.php b/libraries/log4php.debug/Logger.php
index ac191721e8bad8b681c1e4ff87e14a84ff516569..3e2eaf9ca0510d09019a04a7433ea5c0c65462d5 100644
--- a/libraries/log4php.debug/Logger.php
+++ b/libraries/log4php.debug/Logger.php
@@ -18,38 +18,32 @@
  * @package log4php
  */
 
-/**
- * LOG4PHP_DIR points to the log4php root directory.
- *
- * If not defined it will be set automatically when the first package classfile 
- * is included
- * 
- * @var string 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__));
+if (function_exists('__autoload')) {
+	trigger_error("log4php: It looks like your code is using an __autoload() function. log4php uses spl_autoload_register() which will bypass your __autoload() function and may break autoloading.", E_USER_WARNING);
+}
 
 spl_autoload_register(array('Logger', 'autoload'));
 
 /**
- * This is the central class in the log4j package. Most logging operations, 
- * except configuration, are done through this class. 
- *
- * In log4j this class replaces the Category class. There is no need to 
- * port deprecated classes; log4php Logger class doesn't extend Category.
- *
+ * This is the central class in the log4php package. All logging operations 
+ * are done through this class.
+ * 
+ * The main logging methods are:
+ * 	<ul>
+ * 		<li>{@link trace()}</li>
+ * 		<li>{@link debug()}</li>
+ * 		<li>{@link info()}</li>
+ * 		<li>{@link warn()}</li>
+ * 		<li>{@link error()}</li>
+ * 		<li>{@link fatal()}</li>
+ * 	</ul>
+ * 
  * @category   log4php
- * @package log4php
+ * @package    log4php
  * @license	   http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
- * @version	   SVN: $Id: Logger.php 824193 2009-10-11 22:51:24Z chammers $
+ * @version	   SVN: $Id: Logger.php 1137439 2011-06-19 21:13:04Z ihabunek $
  * @link	   http://logging.apache.org/log4php
  */
- /*
-  * TODO:
-  * Localization: setResourceBundle($bundle) : not supported
-  * Localization: getResourceBundle: not supported
-  * Localization: getResourceBundleString($key): not supported
-  * Localization: l7dlog($priority, $key, $params, $t) : not supported
-  */
 class Logger {
 	private static $_classes = array(
 		'LoggerException' => '/LoggerException.php',
@@ -75,6 +69,7 @@ class Logger {
 		'LoggerAppenderFile' => '/appenders/LoggerAppenderFile.php',
 		'LoggerAppenderMail' => '/appenders/LoggerAppenderMail.php',
 		'LoggerAppenderMailEvent' => '/appenders/LoggerAppenderMailEvent.php',
+		'LoggerAppenderMongoDB' => '/appenders/LoggerAppenderMongoDB.php',
 		'LoggerAppenderNull' => '/appenders/LoggerAppenderNull.php',
 		'LoggerAppenderPhp' => '/appenders/LoggerAppenderPhp.php',
 		'LoggerAppenderRollingFile' => '/appenders/LoggerAppenderRollingFile.php',
@@ -100,6 +95,7 @@ class Logger {
 		'LoggerClassNamePatternConverter' => '/helpers/LoggerClassNamePatternConverter.php',
 		'LoggerCategoryPatternConverter' => '/helpers/LoggerCategoryPatternConverter.php',
 		'LoggerPatternParser' => '/helpers/LoggerPatternParser.php',
+		'LoggerLayoutBson' => '/layouts/LoggerLayoutBson.php',
 		'LoggerLayoutHtml' => '/layouts/LoggerLayoutHtml.php',
 		'LoggerLayoutSimple' => '/layouts/LoggerLayoutSimple.php',
 		'LoggerLayoutTTCC' => '/layouts/LoggerLayoutTTCC.php',
@@ -108,73 +104,81 @@ class Logger {
 		'LoggerRendererDefault' => '/renderers/LoggerRendererDefault.php',
 		'LoggerRendererObject' => '/renderers/LoggerRendererObject.php',
 		'LoggerRendererMap' => '/renderers/LoggerRendererMap.php',
+		'LoggerRendererException' => '/renderers/LoggerRendererException.php',
 		'LoggerLocationInfo' => '/LoggerLocationInfo.php',
+		'LoggerThrowableInformation' => '/LoggerThrowableInformation.php',
 		'LoggerLoggingEvent' => '/LoggerLoggingEvent.php',
 		'LoggerFilter' => '/LoggerFilter.php',
 		'LoggerFilterDenyAll' => '/filters/LoggerFilterDenyAll.php',
 		'LoggerFilterLevelMatch' => '/filters/LoggerFilterLevelMatch.php',
 		'LoggerFilterLevelRange' => '/filters/LoggerFilterLevelRange.php',
-		'LoggerFilterStringMatch' => '/filters/LoggerFilterStringMatch.php',
+		'LoggerFilterStringMatch' => '/filters/LoggerFilterStringMatch.php'
 	);
 
 	/**
-	 * Class autoloader
-	 * This method is provided to be invoked within an __autoload() magic method.
-	 * @param string class name
+	 * Class autoloader. This method is provided to be invoked within an 
+	 * __autoload() magic method.
+	 * @param string $className The name of the class to load.
 	 */
 	public static function autoload($className) {
 		if(isset(self::$_classes[$className])) {
-			include LOG4PHP_DIR.self::$_classes[$className];
+			include dirname(__FILE__) . self::$_classes[$className];
 		}
 	}
 
 	/**
-	 * Additivity is set to true by default, that is children inherit the 
-	 * appenders of their ancestors by default.
+	 * Logger additivity. If set to true then child loggers will inherit
+	 * the appenders of their ancestors by default.
 	 * @var boolean
 	 */
 	private $additive = true;
 	
-	/** @var string fully qualified class name */
+	/** The Logger's fully qualified class name. */
 	private $fqcn = 'Logger';
 
-	/** @var LoggerLevel The assigned level of this category. */
-	private $level = null;
+	/** The assigned Logger level. */
+	private $level;
 	
-	/** @var string name of this category. */
-	private $name = '';
+	/** The name of this Logger instance. */
+	private $name;
 	
-	/** @var Logger The parent of this category. Null if this is the root logger*/
-	private $parent = null;
+	/** The parent logger. Set to null if this is the root logger. */
+	private $parent;
 	
 	/**
-	 * @var array collection of appenders
+	 * A collection of appenders associated with this logger.
 	 * @see LoggerAppender
 	 */
-	private $aai = array();
+	private $appenders = array();
 
-	/** the hierarchy used by log4php */
+	/** The logger hierarchy used by log4php. */
 	private static $hierarchy;
 	
-	/** the configurator class name */
+	/** 
+	 * Name of the configurator class used to configure log4php. 
+	 * Populated by {@link configure()} and used in {@link initialize()}.
+	 */
 	private static $configurationClass = 'LoggerConfiguratorBasic';
 	
-	/** the path to the configuration file */
-	private static $configurationFile = null;
+	/** 
+	 * Path to the configuration file which may be used by the configurator.
+	 * Populated by {@link configure()} and used in {@link initialize()}. 
+	 */
+	private static $configurationFile;
 	
-	/** inidicates if log4php has already been initialized */
+	/** Inidicates if log4php has been initialized */
 	private static $initialized = false;
 	
 	/**
 	 * Constructor.
-	 * @param  string  $name  Category name	  
+	 * @param string $name Name of the logger.	  
 	 */
 	public function __construct($name) {
 		$this->name = $name;
 	}
 	
 	/**
-	 * Return the category name.
+	 * Returns the logger name.
 	 * @return string
 	 */
 	public function getName() {
@@ -182,12 +186,12 @@ class Logger {
 	} 
 
 	/**
-	 * Returns the parent of this category.
+	 * Returns the parent Logger. Can be null if this is the root logger.
 	 * @return Logger
 	 */
 	public function getParent() {
 		return $this->parent;
-	}	  
+	}
 	
 	/**
 	 * Returns the hierarchy used by this Logger.
@@ -207,13 +211,23 @@ class Logger {
 	
 	/* Logging methods */
 	/**
-	 * Log a message object with the DEBUG level including the caller.
+	 * Log a message object with the TRACE level.
+	 *
+	 * @param mixed $message message
+	 * @param mixed $caller caller object or caller string id
+	 */
+	public function trace($message, $caller = null) {
+		$this->log(LoggerLevel::getLevelTrace(), $message, $caller);
+	} 		
+	
+	/**
+	 * Log a message object with the DEBUG level.
 	 *
 	 * @param mixed $message message
 	 * @param mixed $caller caller object or caller string id
 	 */
 	public function debug($message, $caller = null) {
-		$this->logLevel($message, LoggerLevel::getLevelDebug(), $caller);
+		$this->log(LoggerLevel::getLevelDebug(), $message, $caller);
 	} 
 
 
@@ -224,7 +238,7 @@ class Logger {
 	 * @param mixed $caller caller object or caller string id
 	 */
 	public function info($message, $caller = null) {
-		$this->logLevel($message, LoggerLevel::getLevelInfo(), $caller);
+		$this->log(LoggerLevel::getLevelInfo(), $message, $caller);
 	}
 
 	/**
@@ -234,48 +248,51 @@ class Logger {
 	 * @param mixed $caller caller object or caller string id
 	 */
 	public function warn($message, $caller = null) {
-		$this->logLevel($message, LoggerLevel::getLevelWarn(), $caller);
+		$this->log(LoggerLevel::getLevelWarn(), $message, $caller);
 	}
 	
 	/**
-	 * Log a message object with the ERROR level including the caller.
+	 * Log a message object with the ERROR level.
 	 *
 	 * @param mixed $message message
 	 * @param mixed $caller caller object or caller string id
 	 */
 	public function error($message, $caller = null) {
-		$this->logLevel($message, LoggerLevel::getLevelError(), $caller);
+		$this->log(LoggerLevel::getLevelError(), $message, $caller);
 	}
 	
 	/**
-	 * Log a message object with the FATAL level including the caller.
+	 * Log a message object with the FATAL level.
 	 *
 	 * @param mixed $message message
 	 * @param mixed $caller caller object or caller string id
 	 */
 	public function fatal($message, $caller = null) {
-		$this->logLevel($message, LoggerLevel::getLevelFatal(), $caller);
+		$this->log(LoggerLevel::getLevelFatal(), $message, $caller);
 	}
 	
 	/**
-	 * This method creates a new logging event and logs the event without further checks.
+	 * This method creates a new logging event and logs the event without 
+	 * further checks.
 	 *
-	 * It should not be called directly. Use {@link info()}, {@link debug()}, {@link warn()},
-	 * {@link error()} and {@link fatal()} wrappers.
+	 * It should not be called directly. Use {@link trace()}, {@link debug()},
+	 * {@link info()}, {@link warn()}, {@link error()} and {@link fatal()} 
+	 * wrappers.
 	 *
-	 * @param string $fqcn Fully Qualified Class Name of the Logger
+	 * @param string $fqcn Fully qualified class name of the Logger
 	 * @param mixed $caller caller object or caller string id
 	 * @param LoggerLevel $level log level	   
-	 * @param mixed $message message
-	 * @see LoggerLoggingEvent			
+	 * @param mixed $message message to log
 	 */
 	public function forcedLog($fqcn, $caller, $level, $message) {
-		$this->callAppenders(new LoggerLoggingEvent($fqcn, $this, $level, $message));
+		$throwable = ($caller !== null && $caller instanceof Exception) ? $caller : null;
+		
+		$this->callAppenders(new LoggerLoggingEvent($fqcn, $this, $level, $message, null, $throwable));
 	} 
 	
 	
-		/**
-	 * Check whether this category is enabled for the DEBUG Level.
+	/**
+	 * Check whether this Logger is enabled for the DEBUG Level.
 	 * @return boolean
 	 */
 	public function isDebugEnabled() {
@@ -283,7 +300,7 @@ class Logger {
 	}		
 
 	/**
-	 * Check whether this category is enabled for a given Level passed as parameter.
+	 * Check whether this Logger is enabled for a given Level passed as parameter.
 	 *
 	 * @param LoggerLevel level
 	 * @return boolean
@@ -293,19 +310,18 @@ class Logger {
 	} 
 
 	/**
-	 * Check whether this category is enabled for the info Level.
+	 * Check whether this Logger is enabled for the INFO Level.
 	 * @return boolean
-	 * @see LoggerLevel
 	 */
 	public function isInfoEnabled() {
 		return $this->isEnabledFor(LoggerLevel::getLevelInfo());
 	} 
 
 	/**
-	 * This generic form is intended to be used by wrappers.
+	 * Log a message using the provided logging level.
 	 *
-	 * @param LoggerLevel $priority a valid level
-	 * @param mixed $message message
+	 * @param LoggerLevel $priority The logging level.
+	 * @param mixed $message Message to log.
 	 * @param mixed $caller caller object or caller string id
 	 */
 	public function log($priority, $message, $caller = null) {
@@ -315,7 +331,7 @@ class Logger {
 	}
 	
 	/**
-	 * If assertion parameter is false, then logs msg as an error statement.
+	 * If assertion parameter is false, then logs the message as an error.
 	 *
 	 * @param bool $assertion
 	 * @param string $msg message to log
@@ -325,12 +341,6 @@ class Logger {
 			$this->error($msg);
 		}
 	}
-	 
-	private function logLevel($message, $level, $caller = null) {
-		if($level->isGreaterOrEqual($this->getEffectiveLevel())) {
-			$this->forcedLog($this->fqcn, $caller, $level, $message);
-		}
-	} 
 	
 	/* Factory methods */ 
 	
@@ -350,7 +360,7 @@ class Logger {
 	}
 	
 	/**
-	 * get the Root Logger (Delegate to {@link Logger})
+	 * Get the Root Logger (Delegate to {@link Logger})
 	 * @return LoggerRoot
 	 * @static 
 	 */	   
@@ -364,20 +374,20 @@ class Logger {
 	/* Configuration methods */
 	
 	/**
-	 * Add a new Appender to the list of appenders of this Category instance.
+	 * Add a new appender to the Logger.
 	 *
-	 * @param LoggerAppender $newAppender
+	 * @param LoggerAppender $appender The appender to add.
 	 */
-	public function addAppender($newAppender) {
-		$appenderName = $newAppender->getName();
-		$this->aai[$appenderName] = $newAppender;
+	public function addAppender($appender) {
+		$appenderName = $appender->getName();
+		$this->appenders[$appenderName] = $appender;
 	}
 	
 	/**
-	 * Remove all previously added appenders from this Category instance.
+	 * Remove all previously added appenders from the Logger.
 	 */
 	public function removeAllAppenders() {
-		$appenderNames = array_keys($this->aai);
+		$appenderNames = array_keys($this->appenders);
 		$enumAppenders = count($appenderNames);
 		for($i = 0; $i < $enumAppenders; $i++) {
 			$this->removeAppender($appenderNames[$i]); 
@@ -385,54 +395,54 @@ class Logger {
 	} 
 			
 	/**
-	 * Remove the appender passed as parameter form the list of appenders.
+	 * Remove the appender passed as parameter form the Logger.
 	 *
-	 * @param mixed $appender can be an appender name or a {@link LoggerAppender} object
+	 * @param string|LoggerAppender $appender an appender name or a {@link LoggerAppender} instance.
 	 */
 	public function removeAppender($appender) {
 		if($appender instanceof LoggerAppender) {
 			$appender->close();
-			unset($this->aai[$appender->getName()]);
-		} else if (is_string($appender) and isset($this->aai[$appender])) {
-			$this->aai[$appender]->close();
-			unset($this->aai[$appender]);
+			unset($this->appenders[$appender->getName()]);
+		} else if (is_string($appender) and isset($this->appenders[$appender])) {
+			$this->appenders[$appender]->close();
+			unset($this->appenders[$appender]);
 		}
 	} 
 			
 	/**
-	 * Call the appenders in the hierarchy starting at this.
+	 * Forwards the given logging event to all appenders associated with the 
+	 * Logger.
 	 *
 	 * @param LoggerLoggingEvent $event 
 	 */
 	public function callAppenders($event) {
-		if(count($this->aai) > 0) {
-			foreach(array_keys($this->aai) as $appenderName) {
-				$this->aai[$appenderName]->doAppend($event);
-			}
+		foreach($this->appenders as $appender) {
+			$appender->doAppend($event);
 		}
+		
 		if($this->parent != null and $this->getAdditivity()) {
 			$this->parent->callAppenders($event);
 		}
 	}
 	
 	/**
-	 * Get the appenders contained in this category as an array.
-	 * @return array collection of appenders
+	 * Get the appenders contained in this logger as an array.
+	 * @return array collection of appender names
 	 */
 	public function getAllAppenders() {
-		return array_values($this->aai);
+		return array_values($this->appenders);
 	}
 	
 	/**
-	 * Look for the appender named as name.
+	 * Get an appender by name.
 	 * @return LoggerAppender
 	 */
 	public function getAppender($name) {
-		return $this->aai[$name];
+		return $this->appenders[$name];
 	}
 	
 	/**
-	 * Get the additivity flag for this Category instance.
+	 * Get the additivity flag.
 	 * @return boolean
 	 */
 	public function getAdditivity() {
@@ -440,7 +450,7 @@ class Logger {
 	}
  
 	/**
-	 * Starting from this category, search the category hierarchy for a non-null level and return it.
+	 * Starting from this Logger, search the Logger hierarchy for a non-null level and return it.
 	 * @see LoggerLevel
 	 * @return LoggerLevel or null
 	 */
@@ -454,24 +464,24 @@ class Logger {
 	}
   
 	/**
-	 * Returns the assigned Level, if any, for this Category.
-	 * @return LoggerLevel or null 
+	 * Get the assigned Logger level.
+	 * @return LoggerLevel The assigned level or null if none is assigned. 
 	 */
 	public function getLevel() {
 		return $this->level;
 	}
 	
 	/**
-	 * Set the level of this Category.
+	 * Set the Logger level.
 	 *
-	 * @param LoggerLevel $level a level string or a level constant 
+	 * @param LoggerLevel $level the level to set
 	 */
 	public function setLevel($level) {
 		$this->level = $level;
 	}
 	
 	/**
-	 * Clears all logger definitions
+	 * Clears all Logger definitions from the logger hierarchy.
 	 * 
 	 * @static
 	 * @return boolean 
@@ -496,9 +506,9 @@ class Logger {
 
 	/**
 	 * Safely close all appenders.
-	 * This is not longer necessary due the appenders shutdown via
-	 * destructors. 
-	 * @deprecated
+	 * 
+	 * @deprecated This is no longer necessary due the appenders shutdown via
+	 * destructors.
 	 * @static
 	 */
 	public static function shutdown() {
@@ -528,17 +538,17 @@ class Logger {
 	}
 	
 	/**
-	 * Is the appender passed as parameter attached to this category?
+	 * Checks whether an appender is attached to this logger instance.
 	 *
 	 * @param LoggerAppender $appender
+	 * @return boolean
 	 */
-	public function isAttached($appender) {
-		return isset($this->aai[$appender->getName()]);
+	public function isAttached(LoggerAppender $appender) {
+		return isset($this->appenders[$appender->getName()]);
 	} 
 		   
 	/**
-	 * Set the additivity flag for this Category instance.
-	 *
+	 * Sets the additivity flag.
 	 * @param boolean $additive
 	 */
 	public function setAdditivity($additive) {
@@ -546,30 +556,32 @@ class Logger {
 	}
 
 	/**
-	 * Sets the parent logger of this logger
+	 * Sets the parent logger.
+	 * @param Logger $logger
 	 */
 	public function setParent(Logger $logger) {
 		$this->parent = $logger;
 	} 
 	
 	/**
-	 * Configures Log4PHP.
-	 * This method needs to be called before the first logging event
-	 * has occured. If this methode is never called, the standard configuration
-	 * takes place (@see LoggerConfiguratorBasic).
+	 * Configures log4php by defining a configuration file and/or class.
+	 * 
+	 * This method needs to be called before the first logging event has 
+	 * occured. If this method is not called before then, the standard 
+	 * configuration takes place (@see LoggerConfiguratorBasic).
+	 * 
 	 * If only the configuration file is given, the configurator class will
-	 * be the XML Configurator or the INI Configurator, if no .xml ending
-	 * could be determined.
+	 * be determined by the config file extension.  
 	 * 
-	 * If a custom configurator should be used, the configuration file
-	 * is either null or the path to file the custom configurator uses.
-	 * Make sure the configurator is already or can be loaded by PHP when necessary.
+	 * If a custom configurator class is provided, the configuration file
+	 * should either be null or contain the path to file used by the custom 
+	 * configurator. Make sure the configurator class is already loaded, or
+	 * that it can be included by PHP when necessary.
 	 * 
-	 * @param String $configurationFile the configuration file
-	 * @param String $configurationClass the configurator class
+	 * @param string $configurationFile path to the configuration file
+	 * @param string $configurationClass name of the custom configurator class 
 	 */
-	public static function configure($configurationFile = null, 
-									 $configurationClass = null ) {
+	public static function configure($configurationFile = null, $configurationClass = null ) {
 		if($configurationClass === null && $configurationFile === null) {
 			self::$configurationClass = 'LoggerConfiguratorBasic';
 			return;
@@ -591,30 +603,33 @@ class Logger {
 	}
 	
 	/**
-	 * Returns the current configurator
-	 * @return the configurator
+	 * Returns the current {@link Logger::$configurationClass configurator class}.
+	 * @return string the configurator class name
 	 */
 	public static function getConfigurationClass() {
 		return self::$configurationClass;
 	}
 	
 	/**
-	 * Returns the current configuration file
-	 * @return the configuration file
+	 * Returns the current {@link Logger::$configurationFile configuration file}.
+	 * @return string the configuration file
 	 */
 	public static function getConfigurationFile() {
 		return self::$configurationFile;
 	}
 	
 	/**
-	 * Returns, true, if the log4php framework is already initialized
+	 * Returns true if the log4php framework has been initialized.
+	 * @return boolean 
 	 */
 	private static function isInitialized() {
 		return self::$initialized;
 	}
 	
 	/**
-	 * Initializes the log4php framework.
+	 * Initializes the log4php framework using the provided {@link 
+	 * Logger::$configurationClass configuration class}  and {@link 
+	 * Logger::$configurationFile configuration file}.
 	 * @return boolean
 	 */
 	public static function initialize() {
@@ -624,4 +639,3 @@ class Logger {
 		return $result;
 	}
 }
-?>
diff --git a/libraries/log4php.debug/LoggerAppender.php b/libraries/log4php.debug/LoggerAppender.php
index 105956deeceab6110d7b49478cf0d8cf56cac950..5ab7a8d99f6dfcc649e5e12fc50506881d93551b 100644
--- a/libraries/log4php.debug/LoggerAppender.php
+++ b/libraries/log4php.debug/LoggerAppender.php
@@ -7,7 +7,7 @@
  * (the "License"); you may not use this file except in compliance with
  * the License. You may obtain a copy of the License at
  *
- *	   http://www.apache.org/licenses/LICENSE-2.0
+ *	7 http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
@@ -18,15 +18,10 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__));
- 
 /**
  * Abstract class that defines output logs strategies.
  *
- * @version $Revision: 822392 $
+ * @version $Revision: 1062665 $
  * @package log4php
  */
 abstract class LoggerAppender {
@@ -47,12 +42,12 @@ abstract class LoggerAppender {
 	 * @var LoggerLayout
 	 */
 	protected $layout = null; 
-		   
+	
 	/**
 	 * @var string Appender name
 	 */
 	protected $name;
-		   
+	
 	/**
 	 * @var LoggerLevel There is no level threshold filtering by default.
 	 */
@@ -61,7 +56,7 @@ abstract class LoggerAppender {
 	/**
 	 * @var boolean needs a layout formatting ?
 	 */
-	protected $requiresLayout = false;
+	protected $requiresLayout = true;
 	
 	/**
 	 * Constructor
@@ -136,7 +131,7 @@ abstract class LoggerAppender {
 				case LoggerFilter::NEUTRAL: $f = $f->getNext();
 			}
 		}
-		$this->append($event);	  
+		$this->append($event);
 	}	 
 
 	/**
@@ -219,9 +214,9 @@ abstract class LoggerAppender {
 	 */
 	public function setThreshold($threshold) {
 		if(is_string($threshold)) {
-		   $this->threshold = LoggerOptionConverter::toLevel($threshold, null);
+			$this->threshold = LoggerOptionConverter::toLevel($threshold, null);
 		} else if($threshold instanceof LoggerLevel) {
-		   $this->threshold = $threshold;
+			$this->threshold = $threshold;
 		}
 	}
 	
@@ -244,7 +239,7 @@ abstract class LoggerAppender {
 	 * Derived appenders should override this method if option structure
 	 * requires it.
 	 */
-	abstract public function activateOptions();	   
+	abstract public function activateOptions();
 	
 	/**
 	 * Subclasses of {@link LoggerAppender} should implement 
@@ -264,4 +259,3 @@ abstract class LoggerAppender {
 	 */
 	abstract public function close();
 }
-?>
diff --git a/libraries/log4php.debug/LoggerAppenderPool.php b/libraries/log4php.debug/LoggerAppenderPool.php
index 9f5f74d26ef2aba9d075e929a083885d09b5bc82..99e3e561b388b5c3109fd1c377c876983c042168 100644
--- a/libraries/log4php.debug/LoggerAppenderPool.php
+++ b/libraries/log4php.debug/LoggerAppenderPool.php
@@ -26,7 +26,7 @@
  */
 class LoggerAppenderPool {
 	/* Appender Pool */
-	public static $appenderPool =  null;
+	public static $appenderPool =  array();
 	
 	/**
 	 * 
@@ -52,4 +52,9 @@ class LoggerAppenderPool {
 		}
 		return null;		
 	}
+	
+	public static function clear()
+	{
+		 self::$appenderPool =  array();
+	}
 }
diff --git a/libraries/log4php.debug/LoggerFilter.php b/libraries/log4php.debug/LoggerFilter.php
index cd6ce248b0de1bc6f9d391fb6102c7ae87c40d23..33ac99df9e56c72976640b12c17ceec4fbfd9a41 100644
--- a/libraries/log4php.debug/LoggerFilter.php
+++ b/libraries/log4php.debug/LoggerFilter.php
@@ -50,7 +50,7 @@
  * <p>The philosophy of log4php filters is largely inspired from the
  * Linux ipchains. 
  * 
- * @version $Revision: 822448 $
+ * @version $Revision: 1059292 $
  * @package log4php
  */
 abstract class LoggerFilter {
@@ -69,7 +69,7 @@ abstract class LoggerFilter {
 	
 	/**
 	 * The log event must be dropped immediately without consulting
-	 * with the remaining filters, if any, in the chain.  
+	 * with the remaining filters, if any, in the chain.
 	 */
 	const DENY = -1;
 
@@ -85,8 +85,8 @@ abstract class LoggerFilter {
 	public function activateOptions() {
 	}
 
-	/**	  
-	 * Decide what to do.  
+	/**
+	 * Decide what to do.
 	 * <p>If the decision is {@link LoggerFilter::DENY}, then the event will be
 	 * dropped. If the decision is {@link LoggerFilter::NEUTRAL}, then the next
 	 * filter, if any, will be invoked. If the decision is {@link LoggerFilter::ACCEPT} then
@@ -109,9 +109,9 @@ abstract class LoggerFilter {
 	 */
 	public function addNext($filter) {
 		if($this->next !== null) {
-		    $this->next->addNext($filter);
+			$this->next->addNext($filter);
 		} else {
-		    $this->next = $filter;
+			$this->next = $filter;
 		}
 	}
 	
diff --git a/libraries/log4php.debug/LoggerHierarchy.php b/libraries/log4php.debug/LoggerHierarchy.php
index 78c55bfd89e5f501a4c9d519684eb857b326e7dc..8cccfb58f9608fa9db68e95dd790ae11481aec5f 100644
--- a/libraries/log4php.debug/LoggerHierarchy.php
+++ b/libraries/log4php.debug/LoggerHierarchy.php
@@ -18,19 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__)); 
-
-/**
- */
-//require_once(LOG4PHP_DIR . '/LoggerLog.php');
-require_once(LOG4PHP_DIR . '/LoggerLevel.php');
-require_once(LOG4PHP_DIR . '/LoggerRoot.php');
-require_once(LOG4PHP_DIR . '/renderers/LoggerRendererMap.php');
-//require_once(LOG4PHP_DIR . '/LoggerDefaultCategoryFactory.php');
-
 /**
  * This class is specialized in retrieving loggers by name and also maintaining 
  * the logger hierarchy. The logger hierarchy is dealing with the several Log-Levels
@@ -57,7 +44,7 @@ require_once(LOG4PHP_DIR . '/renderers/LoggerRendererMap.php');
  * to the provision node. Other descendants of the same ancestor add
  * themselves to the previously created provision node.</p>
  *
- * @version $Revision: 822448 $
+ * @version $Revision: 1059292 $
  * @package log4php
  */
  /*
@@ -98,7 +85,7 @@ class LoggerHierarchy {
 	public function clear() {
 		$this->ht = array();
 	}
-	  
+	
 	/**
 	 * Check if the named logger exists in the hierarchy.
 	 * @param string $name
@@ -120,7 +107,7 @@ class LoggerHierarchy {
 	 * Return a new logger instance named as the first parameter using the default factory.
 	 * 
 	 * @param string $name logger name
-	 * @param LoggerFactory $factory a {@link LoggerFactory} instance or null	  
+	 * @param LoggerFactory $factory a {@link LoggerFactory} instance or null
 	 * @return Logger
 	 */
 	public function getLogger($name) {
@@ -218,6 +205,7 @@ class LoggerHierarchy {
 			$loggers[$i]->removeAllAppenders();
 		}
 		$this->rendererMap->clear();
+		LoggerAppenderPool::clear();
 	}
 	
 	/**
@@ -248,7 +236,7 @@ class LoggerHierarchy {
 	public function shutdown() {
 		$this->root->removeAllAppenders();
 		$cats = $this->getCurrentLoggers();
-		$enumCats = count($cats);		  
+		$enumCats = count($cats);
 		if($enumCats > 0) {
 			for($i = 0; $i < $enumCats; $i++) {
 				$cats[$i]->removeAllAppenders();
@@ -256,4 +244,3 @@ class LoggerHierarchy {
 		}
 	}
 } 
-?>
diff --git a/libraries/log4php.debug/LoggerLayout.php b/libraries/log4php.debug/LoggerLayout.php
index 8261a33e4593283cc7f97e9fc2a37ed59f4be7b1..3e0e7496841c3930b921599cafab974e9fbc4ad6 100644
--- a/libraries/log4php.debug/LoggerLayout.php
+++ b/libraries/log4php.debug/LoggerLayout.php
@@ -18,11 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__)); 
-
 /**
  * Extend this abstract class to create your own log layout format.
  *	
@@ -73,4 +68,3 @@ abstract class LoggerLayout {
 		return null;
 	}
 }
-?>
diff --git a/libraries/log4php.debug/LoggerLevel.php b/libraries/log4php.debug/LoggerLevel.php
index b494ce4559552e320633a423dcad40efe3d401ea..e2384d533009f23642f8bce04862a0d283a2d1dd 100644
--- a/libraries/log4php.debug/LoggerLevel.php
+++ b/libraries/log4php.debug/LoggerLevel.php
@@ -18,15 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__));
- 
-/**
- */
-//require_once(LOG4PHP_DIR . '/LoggerLog.php');
-
 /**
  * Defines the minimum set of levels recognized by the system, that is
  * <i>OFF</i>, <i>FATAL</i>, <i>ERROR</i>,
@@ -36,7 +27,7 @@ if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__));
  * <p>The <i>LoggerLevel</i> class may be subclassed to define a larger
  * level set.</p>
  *
- * @version $Revision: 884719 $
+ * @version $Revision: 1059292 $
  * @package log4php
  * @since 0.5
  */
@@ -48,6 +39,7 @@ class LoggerLevel {
 	const WARN = 30000;
 	const INFO = 20000;
 	const DEBUG = 10000;
+	const TRACE = 5000;
 	const ALL = -2147483647;
 
 	/**
@@ -55,17 +47,17 @@ class LoggerLevel {
 	 * @var integer
 	 */
 	private $level;
-  
-  	/**
-   	 * Contains a list of instantiated levels 
-   	 */
-  	private static $levelMap;
-  	
+	
+	/**
+	 * Contains a list of instantiated levels 
+	 */
+	private static $levelMap;
+
 	/**
 	 * @var string
 	 */
 	private $levelStr;
-  
+
 	/**
 	 * @var integer
 	 */
@@ -93,7 +85,7 @@ class LoggerLevel {
 	public function equals($o) {
 		if($o instanceof LoggerLevel) {
 			if($this->level == $o->level) {
-			    return true;
+				return true;
 			}
 		} else {
 			return false;
@@ -171,6 +163,18 @@ class LoggerLevel {
 		}
 		return self::$levelMap[LoggerLevel::DEBUG];
 	}
+	
+	/**
+	 * Returns a Trace Level
+	 * @static
+	 * @return LoggerLevel
+	 */
+	public static function getLevelTrace() {
+		if(!isset(self::$levelMap[LoggerLevel::TRACE])) {
+			self::$levelMap[LoggerLevel::TRACE] = new LoggerLevel(LoggerLevel::TRACE, 'TRACE', 7);
+		}
+		return self::$levelMap[LoggerLevel::TRACE];
+	}	
 
 	/**
 	 * Returns an All Level
@@ -196,7 +200,7 @@ class LoggerLevel {
 	/**
 	 * Returns <i>true</i> if this level has a higher or equal
 	 * level than the level passed as argument, <i>false</i>
-	 * otherwise.  
+	 * otherwise.
 	 * 
 	 * <p>You should think twice before overriding the default
 	 * implementation of <i>isGreaterOrEqual</i> method.
@@ -209,13 +213,20 @@ class LoggerLevel {
 	}
 
 	/**
-	 * Returns the string representation of this priority.
+	 * Returns the string representation of this level.
 	 * @return string
-	 * @final
 	 */
 	public function toString() {
 		return $this->levelStr;
 	}
+	
+	/**
+	 * Returns the string representation of this level.
+	 * @return string
+	 */
+	public function __toString() {
+		return $this->toString();
+	}
 
 	/**
 	 * Returns the integer representation of this level.
@@ -240,6 +251,7 @@ class LoggerLevel {
 			if(is_int($arg)) {
 				switch($arg) {
 					case self::ALL:	return self::getLevelAll();
+					case self::TRACE: return self::getLevelTrace();
 					case self::DEBUG: return self::getLevelDebug();
 					case self::INFO: return self::getLevelInfo();
 					case self::WARN: return self::getLevelWarn();
@@ -251,6 +263,7 @@ class LoggerLevel {
 			} else {
 				switch(strtoupper($arg)) {
 					case 'ALL':	return self::getLevelAll();
+					case 'TRACE': return self::getLevelTrace();
 					case 'DEBUG': return self::getLevelDebug();
 					case 'INFO': return self::getLevelInfo();
 					case 'WARN': return self::getLevelWarn();
@@ -263,4 +276,3 @@ class LoggerLevel {
 		}
 	}
 }
-?>
diff --git a/libraries/log4php.debug/LoggerLoggingEvent.php b/libraries/log4php.debug/LoggerLoggingEvent.php
index 4c545a17e014cace074e274c86d87f3927172156..ccf01c955120cc530f7b50dd0ceec15f625a3cf4 100644
--- a/libraries/log4php.debug/LoggerLoggingEvent.php
+++ b/libraries/log4php.debug/LoggerLoggingEvent.php
@@ -21,7 +21,7 @@
 /**
  * The internal representation of logging event.
  *
- * @version $Revision: 832662 $
+ * @version $Revision: 1059292 $
  * @package log4php
  */
 class LoggerLoggingEvent {
@@ -110,6 +110,11 @@ class LoggerLoggingEvent {
 	*/
 	private $locationInfo = null;
 	
+	/**
+	 * @var LoggerThrowableInformation log4php internal representation of throwable
+	 */
+	private $throwableInfo = null;
+	
 	/**
 	* Instantiate a LoggingEvent from the supplied parameters.
 	*
@@ -121,8 +126,9 @@ class LoggerLoggingEvent {
 	* @param LoggerLevel $priority The level of this event.
 	* @param mixed $message The message of this event.
 	* @param integer $timeStamp the timestamp of this logging event.
+	* @param Exception $throwable The throwable associated with logging event
 	*/
-	public function __construct($fqcn, $logger, $priority, $message, $timeStamp = null) {
+	public function __construct($fqcn, $logger, $priority, $message, $timeStamp = null, Exception $throwable = null) {
 		$this->fqcn = $fqcn;
 		if($logger instanceof Logger) {
 			$this->logger = $logger;
@@ -142,8 +148,20 @@ class LoggerLoggingEvent {
 				$this->timeStamp = floatval(time());
 			}
 		}
+		
+		if ($throwable !== null && $throwable instanceof Exception) {
+			$this->throwableInfo = new LoggerThrowableInformation($throwable);
+		}
 	}
 
+	/**
+	 * Returns the full qualified classname.
+	 * TODO: PHP does contain namespaces in 5.3. Those should be returned too, 
+	 */
+	 public function getFullQualifiedClassname() {
+		 return $this->fqcn;
+	 }
+	 
 	/**
 	 * Set the location information for this logging event. The collected
 	 * information is cached for future use.
@@ -241,7 +259,7 @@ class LoggerLoggingEvent {
 	public function getNDC() {
 		if($this->ndcLookupRequired) {
 			$this->ndcLookupRequired = false;
-			$this->ndc = implode(' ', LoggerNDC::get());
+			$this->ndc = LoggerNDC::get();
 		}
 		return $this->ndc;
 	}
@@ -264,10 +282,10 @@ class LoggerLoggingEvent {
 			if(is_string($this->message)) {
 					$this->renderedMessage = $this->message;
 			} else {
-			    // $this->logger might be null or an instance of Logger or RootLogger
-			    // But in contrast to log4j, in log4php there is only have one LoggerHierarchy so there is
-			    // no need figure out which one is $this->logger part of.
-			    // TODO: Logger::getHierarchy() is marked @deprecated!
+				// $this->logger might be null or an instance of Logger or RootLogger
+				// But in contrast to log4j, in log4php there is only have one LoggerHierarchy so there is
+				// no need figure out which one is $this->logger part of.
+				// TODO: Logger::getHierarchy() is marked @deprecated!
 				$repository = Logger::getHierarchy();
 				$rendererMap = $repository->getRendererMap();
 				$this->renderedMessage= $rendererMap->findAndRender($this->message);
@@ -307,10 +325,10 @@ class LoggerLoggingEvent {
 	 * @return the time after event starttime when this event has occured
 	 */
 	public function getTime() {
-        $eventTime = (float)$this->getTimeStamp();
-        $eventStartTime = (float)LoggerLoggingEvent::getStartTime();
-        return number_format(($eventTime - $eventStartTime) * 1000, 0, '', '');
-    }
+		$eventTime = (float)$this->getTimeStamp();
+		$eventStartTime = (float)LoggerLoggingEvent::getStartTime();
+		return number_format(($eventTime - $eventStartTime) * 1000, 0, '', '');
+	}
 	
 	/**
 	 * @return mixed
@@ -323,10 +341,10 @@ class LoggerLoggingEvent {
 	}
 
 	/**
-	 * @return mixed null
+	 * @return mixed LoggerThrowableInformation
 	 */
 	public function getThrowableInformation() {
-		return null;
+		return $this->throwableInfo;
 	}
 	
 	/**
diff --git a/libraries/log4php.debug/LoggerMDC.php b/libraries/log4php.debug/LoggerMDC.php
index 788723ec102faa2875b95d4998a947a1bc4222a2..34f917955bd55bcea914f5e1490d1c81290e087c 100644
--- a/libraries/log4php.debug/LoggerMDC.php
+++ b/libraries/log4php.debug/LoggerMDC.php
@@ -18,11 +18,6 @@
  * @package log4php
  */
 
-/**
- * This is the global repository of user mappings
- */
-$GLOBALS['log4php.LoggerMDC.ht'] = array();
-
 /**
  * The LoggerMDC class provides <i>mapped diagnostic contexts</i>.
  * 
@@ -50,11 +45,17 @@ $GLOBALS['log4php.LoggerMDC.ht'] = array();
  * 2009-09-13 18:48:28 DEBUG root knut: Testing MDC in src/examples/php/mdc.php at 23
  * </pre>
  * 
- * @version $Revision: 883114 $
+ * @version $Revision: 998444 $
  * @since 0.3
  * @package log4php
  */
 class LoggerMDC {
+	
+	/**
+	 * This is the repository of user mappings
+	 */
+	private static $map = array();
+		
 	/**
 	 * Put a context value as identified with the key parameter into the current thread's
 	 *	context map.
@@ -69,7 +70,7 @@ class LoggerMDC {
 	 * @static
 	 */
 	public static function put($key, $value) {
-		$GLOBALS['log4php.LoggerMDC.ht'][$key] = $value;
+		self::$map[$key] = $value;
 	}
   
 	/**
@@ -81,20 +82,22 @@ class LoggerMDC {
 	 *
 	 * <p>This method has no side effects.</p>
 	 *
-	 * @param string $key
-	 * @return string
+	 * @param string $key the key
+	 * @return string the context or an empty string if no context found
+	 * 	for given key
 	 * @static
 	 */
 	public static function get($key) {
 		if(!empty($key)) {
 			if(strpos($key, 'server.') === 0) {
 				$varName = substr($key, 7);
-				return @$_SERVER[$varName];
+				return isset($_SERVER[$varName]) ? $_SERVER[$varName] : '';
 			} else if(strpos($key, 'env.') === 0) {
 				$varName = substr($key, 4);
-				return @$_ENV[$varName];
-			} else if (isset($GLOBALS['log4php.LoggerMDC.ht'][$key])) {
-				return $GLOBALS['log4php.LoggerMDC.ht'][$key];
+				$value = getenv($varName);
+				return ($value !== false) ? $value : '';
+			} else {
+				return isset(self::$map[$key]) ? self::$map[$key] : '';
 			}
 		}
 		return '';
@@ -103,15 +106,12 @@ class LoggerMDC {
 	/**
 	 * Remove the the context identified by the key parameter. 
 	 *
-	 * It only affects user mappings.
+	 * It only affects user mappings, not $_ENV or $_SERVER.
 	 *
-	 * @param string $key
-	 * @return string
+	 * @param string $key the key to be removed
 	 * @static
 	 */
 	public static function remove($key) {
-		unset($GLOBALS['log4php.LoggerMDC.ht'][$key]);
+		unset(self::$map[$key]);
 	}
-
 }
-?>
diff --git a/libraries/log4php.debug/LoggerNDC.php b/libraries/log4php.debug/LoggerNDC.php
index 48d7b61b2d17306d780e5cfdfcb0421289bc03a9..b7283ac17518d4fdffebc78ddcefb746ac9fa7f9 100644
--- a/libraries/log4php.debug/LoggerNDC.php
+++ b/libraries/log4php.debug/LoggerNDC.php
@@ -18,19 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__)); 
- 
-/**
- */
-
-/**
- * This is the global repository of NDC stack
- */
-$GLOBALS['log4php.LoggerNDC.ht'] = array();
-
 /**
  * The NDC class implements <i>nested diagnostic contexts</i>.
  * 
@@ -102,12 +89,15 @@ $GLOBALS['log4php.LoggerNDC.ht'] = array();
  * 2009-09-13 19:04:27 DEBUG root : back and waiting for new connections in src/examples/php/ndc.php at 29
  * </pre>
  *	
- * @version $Revision: 883114 $
+ * @version $Revision: 998456 $
  * @package log4php 
  * @since 0.3
  */
 class LoggerNDC {
-	const HT_SIZE = 7;
+	
+	/** This is the repository of NDC stack */
+	private static $stack = array();
+	
 	/**
 	 * Clear any nested diagnostic information if any. This method is
 	 * useful in cases where the same thread can be potentially used
@@ -116,10 +106,10 @@ class LoggerNDC {
 	 * <p>This method is equivalent to calling the {@link setMaxDepth()}
 	 * method with a zero <var>maxDepth</var> argument.
 	 *
-	 * @static	
+	 * @static
 	 */
 	public static function clear() {
-		$GLOBALS['log4php.LoggerNDC.ht'] = array();
+		self::$stack = array();
 	}
 
 	/**
@@ -128,10 +118,7 @@ class LoggerNDC {
 	 * @return array
 	 */
 	public static function get() {
-		if(!array_key_exists('log4php.LoggerNDC.ht', $GLOBALS)) {
-			LoggerNDC::clear();
-		}
-		return $GLOBALS['log4php.LoggerNDC.ht'];
+		return implode(' ', self::$stack);
 	}
   
 	/**
@@ -142,7 +129,7 @@ class LoggerNDC {
 	 * @static
 	 */
 	public static function getDepth() {
-		return count($GLOBALS['log4php.LoggerNDC.ht']);	  
+		return count(self::$stack);
 	}
 
 	/**
@@ -156,8 +143,8 @@ class LoggerNDC {
 	 * @static
 	 */
 	public static function pop() {
-		if(count($GLOBALS['log4php.LoggerNDC.ht']) > 0) {
-			return array_pop($GLOBALS['log4php.LoggerNDC.ht']);
+		if(count(self::$stack) > 0) {
+			return array_pop(self::$stack);
 		} else {
 			return '';
 		}
@@ -173,8 +160,8 @@ class LoggerNDC {
 	 * @static
 	 */
 	public static function peek(){
-		if(count($GLOBALS['log4php.LoggerNDC.ht']) > 0) {
-			return end($GLOBALS['log4php.LoggerNDC.ht']);
+		if(count(self::$stack) > 0) {
+			return end(self::$stack);
 		} else {
 			return '';
 		}
@@ -190,7 +177,7 @@ class LoggerNDC {
 	 * @static	
 	 */
 	public static function push($message) {
-		array_push($GLOBALS['log4php.LoggerNDC.ht'], (string)$message);
+		array_push(self::$stack, (string)$message);
 	}
 
 	/**
@@ -218,12 +205,8 @@ class LoggerNDC {
 	 */
 	public static function setMaxDepth($maxDepth) {
 		$maxDepth = (int)$maxDepth;
-		if($maxDepth <= self::HT_SIZE) {
-			if(LoggerNDC::getDepth() > $maxDepth) {
-				$GLOBALS['log4php.LoggerNDC.ht'] = array_slice($GLOBALS['log4php.LoggerNDC.ht'], $maxDepth);
-			}
+		if(LoggerNDC::getDepth() > $maxDepth) {
+			self::$stack = array_slice(self::$stack, 0, $maxDepth);
 		}
 	}
-
 }
-?>
diff --git a/libraries/log4php.debug/LoggerReflectionUtils.php b/libraries/log4php.debug/LoggerReflectionUtils.php
index 8a8c0db3ccd2c765762fca6c40b29354ff2ab742..bd7a304a1892f24e11456b6ecdbb9091240c50c5 100644
--- a/libraries/log4php.debug/LoggerReflectionUtils.php
+++ b/libraries/log4php.debug/LoggerReflectionUtils.php
@@ -18,14 +18,14 @@
  * @package log4php
  */
  
- /**
-  * Provides methods for reflective use on php objects
-  * @package log4php
-  */
+/**
+ * Provides methods for reflective use on php objects
+ * @package log4php
+ */
 class LoggerReflectionUtils {
 		/** the target object */
 	private $obj;
-  
+	
 	/**
 	 * Create a new LoggerReflectionUtils for the specified Object. 
 	 * This is done in prepartion for invoking {@link setProperty()} 
@@ -35,7 +35,7 @@ class LoggerReflectionUtils {
 	public function __construct($obj) {
 		$this->obj = $obj;
 	}
-  
+	
 	/**
 	 * Set the properties of an object passed as a parameter in one
 	 * go. The <code>properties</code> are parsed relative to a
@@ -51,8 +51,8 @@ class LoggerReflectionUtils {
 		$pSetter = new LoggerReflectionUtils($obj);
 		return $pSetter->setProperties($properties, $prefix);
 	}
-  
-
+	
+	
 	/**
 	 * Set the properites for the object that match the
 	 * <code>prefix</code> passed as parameter.
@@ -69,6 +69,7 @@ class LoggerReflectionUtils {
 	 // TODO: check, if this is really useful
 	public function setProperties($properties, $prefix) {
 		$len = strlen($prefix);
+		reset($properties);
 		while(list($key,) = each($properties)) {
 			if(strpos($key, $prefix) === 0) {
 				if(strpos($key, '.', ($len + 1)) > 0) {
@@ -97,8 +98,8 @@ class LoggerReflectionUtils {
 	 * to an int using new Integer(value). If the setter expects a boolean,
 	 * the conversion is by new Boolean(value).
 	 *
-	 * @param string $name	  name of the property
-	 * @param string $value	  String value of the property
+	 * @param string $name	name of the property
+	 * @param string $value	String value of the property
 	 */
 	public function setProperty($name, $value) {
 		if($value === null) {
@@ -113,7 +114,7 @@ class LoggerReflectionUtils {
 			return call_user_func(array($this->obj, $method), $value);
 		} 
 	}
-  
+	
 	public function activate() {
 		if(method_exists($this->obj, 'activateoptions')) {
 			return call_user_func(array($this->obj, 'activateoptions'));
@@ -135,20 +136,20 @@ class LoggerReflectionUtils {
 	}
 	
 	/**
-     * @param object $object
-     * @param string $name
-     * @param mixed $value
-     */
-    public static function setter($object, $name, $value) {
-        if (empty($name)) {
-            return false;
-        }
-        $methodName = 'set'.ucfirst($name);
-        if (method_exists($object, $methodName)) {
-            return call_user_func(array($object, $methodName), $value);
-        } else {
-            return false;
-        }
-    }
+	 * @param object $object
+	 * @param string $name
+	 * @param mixed $value
+	 */
+	public static function setter($object, $name, $value) {
+		if (empty($name)) {
+			return false;
+		}
+		$methodName = 'set'.ucfirst($name);
+		if (method_exists($object, $methodName)) {
+			return call_user_func(array($object, $methodName), $value);
+		} else {
+			return false;
+		}
+	}
 	
 }
diff --git a/libraries/log4php.debug/LoggerRoot.php b/libraries/log4php.debug/LoggerRoot.php
index d1b8ff35c49b9ae8d4e2f4f9b0e3304cce70bc90..780b270480b671c29751d4e448b25f002378d23f 100644
--- a/libraries/log4php.debug/LoggerRoot.php
+++ b/libraries/log4php.debug/LoggerRoot.php
@@ -68,4 +68,3 @@ class LoggerRoot extends Logger {
 	}
 
 }
-?>
diff --git a/libraries/log4php.debug/LoggerThrowableInformation.php b/libraries/log4php.debug/LoggerThrowableInformation.php
new file mode 100644
index 0000000000000000000000000000000000000000..75511c98cad6d2b0258907f2869962ef0a721944
--- /dev/null
+++ b/libraries/log4php.debug/LoggerThrowableInformation.php
@@ -0,0 +1,76 @@
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *	   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @package log4php
+ */
+
+/**
+ * The internal representation of throwables.
+ *
+ * @package log4php
+ * @since 2.1
+ */
+class LoggerThrowableInformation {
+	
+	/** @var Exception Throwable to log */
+	private $throwable;
+	
+	/** @var array Array of throwable messages */
+	private $throwableArray;
+	
+	/** @var Logger reference */
+	private $logger;
+	
+	/**
+	 * Create a new instance
+	 * 
+	 * @param $throwable - a throwable as a exception
+	 * @param $logger - Logger reference
+	 */
+	public function __construct(Exception $throwable)  {
+		$this->throwable = $throwable;
+	}
+	
+	/**
+	* Return source exception
+	* 
+	* @return Exception
+	*/
+	public function getThrowable() {
+		return $this->throwable;
+	}
+	
+	/**
+	 * @desc Returns string representation of throwable
+	 * 
+	 * @return array 
+	 */
+	public function getStringRepresentation() {
+		if (!is_array($this->throwableArray)) {
+			$renderer = Logger::getHierarchy()->getRendererMap()->getByClassName(get_class($this->throwable));
+			
+			// TODO: why this?
+			if ($renderer instanceof LoggerRendererDefault) {
+				$renderer = new LoggerRendererException();
+			}
+			$this->throwableArray = explode("\n", $renderer->render($this->throwable));
+		}
+		
+		return $this->throwableArray;
+	}
+}
+?>
\ No newline at end of file
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderAdodb.php b/libraries/log4php.debug/appenders/LoggerAppenderAdodb.php
index 4724939fe30ac7df45ba51e3351c2146914b0bd9..bb6d1de0f60cad79115cfe20a134f4d746f80a6c 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderAdodb.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderAdodb.php
@@ -36,228 +36,228 @@ require_once(ADODB_DIR . '/adodb.inc.php');
  */
 class LoggerAppenderAdodb extends LoggerAppender {
 
-    /**
-     * Create the log table if it does not exists (optional).
-     * @var boolean
-     */
-    var $createTable = true;
-    
-    /**
-     * The type of database to connect to
-     * @var string
-     */
-    var $type;
-    
-    /**
-     * Database user name
-     * @var string
-     */
-    var $user;
-    
-    /**
-     * Database password
-     * @var string
-     */
-    var $password;
-    
-    /**
-     * Database host to connect to
-     * @var string
-     */
-    var $host;
-    
-    /**
-     * Name of the database to connect to
-     * @var string
-     */
-    var $database;
-    
-    /**
-     * A {@link LoggerPatternLayout} string used to format a valid insert query (mandatory).
-     * @var string
-     */
-    var $sql;
-    
-    /**
-     * Table name to write events. Used only if {@link $createTable} is true.
-     * @var string
-     */    
-    var $table;
-    
-    /**
-     * @var object Adodb instance
-     * @access private
-     */
-    var $db = null;
-    
-    /**
-     * @var boolean used to check if all conditions to append are true
-     * @access private
-     */
-    var $canAppend = true;
-    
-    /**    
-     * @access private
-     */
-    var $requiresLayout = false;
-    
-    /**
-     * Constructor.
-     *
-     * @param string $name appender name
-     */
-    function __construct($name)
-    {
-        parent::__construct($name);
-    }
+	/**
+	 * Create the log table if it does not exists (optional).
+	 * @var boolean
+	 */
+	var $createTable = true;
+	
+	/**
+	 * The type of database to connect to
+	 * @var string
+	 */
+	var $type;
+	
+	/**
+	 * Database user name
+	 * @var string
+	 */
+	var $user;
+	
+	/**
+	 * Database password
+	 * @var string
+	 */
+	var $password;
+	
+	/**
+	 * Database host to connect to
+	 * @var string
+	 */
+	var $host;
+	
+	/**
+	 * Name of the database to connect to
+	 * @var string
+	 */
+	var $database;
+	
+	/**
+	 * A {@link LoggerPatternLayout} string used to format a valid insert query (mandatory).
+	 * @var string
+	 */
+	var $sql;
+	
+	/**
+	 * Table name to write events. Used only if {@link $createTable} is true.
+	 * @var string
+	 */	
+	var $table;
+	
+	/**
+	 * @var object Adodb instance
+	 * @access private
+	 */
+	var $db = null;
+	
+	/**
+	 * @var boolean used to check if all conditions to append are true
+	 * @access private
+	 */
+	var $canAppend = true;
+	
+	/**	
+	 * @access private
+	 */
+	var $requiresLayout = false;
+	
+	/**
+	 * Constructor.
+	 *
+	 * @param string $name appender name
+	 */
+	function __construct($name)
+	{
+		parent::__construct($name);
+	}
 
-    /**
-     * Setup db connection.
-     * Based on defined options, this method connects to db defined in {@link $dsn}
-     * and creates a {@link $table} table if {@link $createTable} is true.
-     * @return boolean true if all ok.
-     */
-    function activateOptions()
-    {        
-        $this->db = &ADONewConnection($this->type);
-        if (! $this->db->PConnect($this->host, $this->user, $this->password, $this->database)) {
-          $this->db = null;
-          $this->closed = true;
-          $this->canAppend = false;
-          return;
-        }
-        
-        $this->layout = LoggerReflectionUtils::createObject('LoggerLayoutPattern');
-        $this->layout->setConversionPattern($this->getSql());
-    
-        // test if log table exists
-        $sql = 'select * from ' . $this->table . ' where 1 = 0';
-        $dbrs = $this->db->Execute($sql);
-        if ($dbrs == false and $this->getCreateTable()) {
-            $query = "CREATE TABLE {$this->table} (timestamp varchar(32),logger varchar(32),level varchar(32),message varchar(64),thread varchar(32),file varchar(64),line varchar(4) );";
+	/**
+	 * Setup db connection.
+	 * Based on defined options, this method connects to db defined in {@link $dsn}
+	 * and creates a {@link $table} table if {@link $createTable} is true.
+	 * @return boolean true if all ok.
+	 */
+	function activateOptions()
+	{		
+		$this->db = &ADONewConnection($this->type);
+		if (! $this->db->PConnect($this->host, $this->user, $this->password, $this->database)) {
+			$this->db = null;
+			$this->closed = true;
+			$this->canAppend = false;
+			return;
+		}
+		
+		$this->layout = LoggerReflectionUtils::createObject('LoggerLayoutPattern');
+		$this->layout->setConversionPattern($this->getSql());
+	
+		// test if log table exists
+		$sql = 'select * from ' . $this->table . ' where 1 = 0';
+		$dbrs = $this->db->Execute($sql);
+		if ($dbrs == false and $this->getCreateTable()) {
+			$query = "CREATE TABLE {$this->table} (timestamp varchar(32),logger varchar(32),level varchar(32),message varchar(64),thread varchar(32),file varchar(64),line varchar(4) );";
 
-                     
-            $result = $this->db->Execute($query);
-            if (! $result) {
-                $this->canAppend = false;
-                return;
-            }
-        }
-        $this->canAppend = true;
-    }
-    
-    function append(LoggerLoggingEvent $event) {
-        if ($this->canAppend) {
-            $query = $this->layout->format($event);
-            $this->db->Execute($query);
-        }
-    }
-    
-    function close()
-    {
-        if ($this->db !== null)
-            $this->db->Close();
-        $this->closed = true;
-    }
-    
-    /**
-     * @return boolean
-     */
-    function getCreateTable()
-    {
-        return $this->createTable;
-    }
-    
-    /**
-     * @return string the sql pattern string
-     */
-    function getSql()
-    {
-        return $this->sql;
-    }
-    
-    /**
-     * @return string the table name to create
-     */
-    function getTable()
-    {
-        return $this->table;
-    }
-    
-    /**
-     * @return string the database to connect to
-     */
-    function getDatabase() {
-        return $this->database;
-    }
-    
-    /**
-     * @return string the database to connect to
-     */
-    function getHost() {
-        return $this->host;
-    }
-    
-    /**
-     * @return string the user to connect with
-     */
-    function getUser() {
-        return $this->user;
-    }
-    
-    /**
-     * @return string the password to connect with
-     */
-    function getPassword() {
-        return $this->password;
-    }
-    
-    /**
-     * @return string the type of database to connect to
-     */
-    function getType() {
-        return $this->type;
-    }
-    
-    function setCreateTable($flag)
-    {
-        $this->createTable = LoggerOptionConverter::toBoolean($flag, true);
-    }
-    
-    function setType($newType)
-    {
-        $this->type = $newType;
-    }
-    
-    function setDatabase($newDatabase)
-    {
-        $this->database = $newDatabase;
-    }
-    
-    function setHost($newHost)
-    {
-        $this->host = $newHost;
-    }
-    
-    function setUser($newUser)
-    {
-        $this->user = $newUser;
-    }
-    
-    function setPassword($newPassword)
-    {
-        $this->password = $newPassword;
-    }
-    
-    function setSql($sql)
-    {
-        $this->sql = $sql;    
-    }
-    
-    function setTable($table)
-    {
-        $this->table = $table;
-    }
-    
+					 
+			$result = $this->db->Execute($query);
+			if (! $result) {
+				$this->canAppend = false;
+				return;
+			}
+		}
+		$this->canAppend = true;
+	}
+	
+	function append(LoggerLoggingEvent $event) {
+		if ($this->canAppend) {
+			$query = $this->layout->format($event);
+			$this->db->Execute($query);
+		}
+	}
+	
+	function close()
+	{
+		if ($this->db !== null)
+			$this->db->Close();
+		$this->closed = true;
+	}
+	
+	/**
+	 * @return boolean
+	 */
+	function getCreateTable()
+	{
+		return $this->createTable;
+	}
+	
+	/**
+	 * @return string the sql pattern string
+	 */
+	function getSql()
+	{
+		return $this->sql;
+	}
+	
+	/**
+	 * @return string the table name to create
+	 */
+	function getTable()
+	{
+		return $this->table;
+	}
+	
+	/**
+	 * @return string the database to connect to
+	 */
+	function getDatabase() {
+		return $this->database;
+	}
+	
+	/**
+	 * @return string the database to connect to
+	 */
+	function getHost() {
+		return $this->host;
+	}
+	
+	/**
+	 * @return string the user to connect with
+	 */
+	function getUser() {
+		return $this->user;
+	}
+	
+	/**
+	 * @return string the password to connect with
+	 */
+	function getPassword() {
+		return $this->password;
+	}
+	
+	/**
+	 * @return string the type of database to connect to
+	 */
+	function getType() {
+		return $this->type;
+	}
+	
+	function setCreateTable($flag)
+	{
+		$this->createTable = LoggerOptionConverter::toBoolean($flag, true);
+	}
+	
+	function setType($newType)
+	{
+		$this->type = $newType;
+	}
+	
+	function setDatabase($newDatabase)
+	{
+		$this->database = $newDatabase;
+	}
+	
+	function setHost($newHost)
+	{
+		$this->host = $newHost;
+	}
+	
+	function setUser($newUser)
+	{
+		$this->user = $newUser;
+	}
+	
+	function setPassword($newPassword)
+	{
+		$this->password = $newPassword;
+	}
+	
+	function setSql($sql)
+	{
+		$this->sql = $sql;	
+	}
+	
+	function setTable($table)
+	{
+		$this->table = $table;
+	}
+	
 }
 
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderConsole.php b/libraries/log4php.debug/appenders/LoggerAppenderConsole.php
index 7f1fe912815f566c54f19b4e0d95c584de3bd248..c9e53baa1529e6d52027b5aefbeb31dccdd6e32f 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderConsole.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderConsole.php
@@ -17,7 +17,6 @@
  *
  * @package log4php
  */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
 
 /**
  * ConsoleAppender appends log events to STDOUT or STDERR. 
@@ -38,7 +37,7 @@ if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
  * 
  * {@example ../../examples/resources/appender_console.properties 18}
  * 
- * @version $Revision: 883108 $
+ * @version $Revision: 1062667 $
  * @package log4php
  * @subpackage appenders
  */
@@ -50,26 +49,19 @@ class LoggerAppenderConsole extends LoggerAppender {
 	/**
 	 * Can be 'php://stdout' or 'php://stderr'. But it's better to use keywords <b>STDOUT</b> and <b>STDERR</b> (case insensitive). 
 	 * Default is STDOUT
-	 * @var string	  
+	 * @var string
 	 */
 	private $target = self::STDOUT;
 	
-	/**
-	 * @var boolean
-	 * @access private	   
-	 */
-	protected $requiresLayout = true;
-
 	/**
 	 * @var mixed the resource used to open stdout/stderr
-	 * @access private	   
 	 */
 	protected $fp = null;
 
 	public function __destruct() {
-       $this->close();
-   	}
-   	
+		$this->close();
+	}
+	
 	/**
 	 * Set console target.
 	 * @param mixed $value a constant or a string
@@ -80,7 +72,7 @@ class LoggerAppenderConsole extends LoggerAppender {
 			$this->target = self::STDOUT;
 		} elseif ($v == self::STDERR || strtoupper($v) == 'STDERR') {
 			$this->target = self::STDERR;
-		} 
+		}
 	}
 
 	public function activateOptions() {
@@ -88,7 +80,7 @@ class LoggerAppenderConsole extends LoggerAppender {
 		if(is_resource($this->fp) && $this->layout !== null) {
 			fwrite($this->fp, $this->layout->getHeader());
 		}
-		$this->closed = (bool)is_resource($this->fp) === false; 
+		$this->closed = (bool)is_resource($this->fp) === false;
 	}
 	
 	/**
@@ -101,13 +93,13 @@ class LoggerAppenderConsole extends LoggerAppender {
 				fclose($this->fp);
 			}
 			$this->closed = true;
-		}			 
+		}
 	}
 
 	public function append(LoggerLoggingEvent $event) {
 		if (is_resource($this->fp) && $this->layout !== null) {
 			fwrite($this->fp, $this->layout->format($event));
-		} 
+		}
 	}
 }
 
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderDailyFile.php b/libraries/log4php.debug/appenders/LoggerAppenderDailyFile.php
index d1340411673958b3089102094dd45f4d8089db89..471c4d781f73e0e48849cd469bb316d4e1220ab7 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderDailyFile.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderDailyFile.php
@@ -18,21 +18,23 @@
  * @package log4php
  */
 
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
- 
-require_once(LOG4PHP_DIR . '/appenders/LoggerAppenderFile.php');
-
 /**
  * An Appender that automatically creates a new logfile each day.
  *
  * The file is rolled over once a day. That means, for each day a new file 
  * is created. A formatted version of the date pattern is used as to create 
  * the file name using the {@link PHP_MANUAL#sprintf} function.
+ *
+ * This appender uses a layout.
  * 
- * - layout             - Sets the layout class for this appender
- * - datePattern        - Sets date format for the file name. Should be set before $file!
- * - file               - The target file name. Should contain a '%s' which gets substituted by the date.
- * - append             - Sets if the appender should append to the end of the file or overwrite content ("true" or "false")
+ * Configurable parameters for this appender are:
+ * - datePattern - The date format for the file name. Should be set before 
+ *                 $file. Default value: "Ymd".
+ * - file        - The path to the target log file. The filename should 
+ *                 contain a '%s' which will be substituted by the date.
+ * - append      - Sets if the appender should append to the end of the
+ *                 file or overwrite content ("true" or "false"). Default 
+ *                 value: true.
  * 
  * An example php file:
  * 
@@ -44,7 +46,7 @@ require_once(LOG4PHP_DIR . '/appenders/LoggerAppenderFile.php');
  *
  * The above will create a file like: daily_20090908.log
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1059522 $
  * @package log4php
  * @subpackage appenders
  */
@@ -58,41 +60,33 @@ class LoggerAppenderDailyFile extends LoggerAppenderFile {
 	public $datePattern = "Ymd";
 	
 	public function __destruct() {
-       parent::__destruct();
-   	}
-   	
+		parent::__destruct();
+	}
+	
 	/**
-	* Sets date format for the file name.
-	* @param string $format a regular date() string format
-	*/
-	public function setDatePattern($format) {
-		$this->datePattern = $format;
+	 * Sets date format for the file name.
+	 * @param string $datePattern a regular date() string format
+	 */
+	public function setDatePattern($datePattern) {
+		$this->datePattern = $datePattern;
 	}
 	
 	/**
-	* @return string returns date format for the filename
-	*/
+	 * @return string returns date format for the filename
+	 */
 	public function getDatePattern() {
 		return $this->datePattern;
 	}
 	
 	/**
-	* The File property takes a string value which should be the name of the file to append to.
-	* Sets and opens the file where the log output will go.
-	*
-	* @see LoggerAppenderFile::setFile()
-	*/
-	public function setFile() {
-		$numargs = func_num_args();
-		$args = func_get_args();
-		
-		if($numargs == 1 and is_string($args[0])) {
-			parent::setFile( sprintf((string)$args[0], date($this->getDatePattern())) );
-		} else if ($numargs == 2 and is_string($args[0]) and is_bool($args[1])) {
-			parent::setFile( sprintf((string)$args[0], date($this->getDatePattern())), $args[1] );
-		}
-	} 
-
+	 * Similar to the parent method, but replaces "%s" in the file name with 
+	 * the current date in format specified by $datePattern. 
+	 *
+	 * @see LoggerAppenderFile::setFile()
+	 */
+	public function setFile($file) {
+		$date = date($this->getDatePattern());
+		$file = sprintf($file, $date);
+		parent::setFile(sprintf($file, $date));
+	}
 }
-
-?>
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderEcho.php b/libraries/log4php.debug/appenders/LoggerAppenderEcho.php
index 29447844315469163b9af6eaa040489f15c3aaec..91ae2c39583414b55c9459f4445f1834659548d8 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderEcho.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderEcho.php
@@ -18,14 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
- 
-/**
- */
-
 /**
  * LoggerAppenderEcho uses {@link PHP_MANUAL#echo echo} function to output events. 
  * 
@@ -44,7 +36,7 @@ if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
  *    Tue Sep  8 22:44:55 2009,812 [6783] DEBUG appender_echo - Hello World!
  * </pre>
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1062665 $
  * @package log4php
  * @subpackage appenders
  */
@@ -52,16 +44,21 @@ class LoggerAppenderEcho extends LoggerAppender {
 	/** boolean used internally to mark first append */
 	private $firstAppend = true;
 	
+	/** 
+	 * If set to true, a <br /> element will be inserted before each line
+	 * break in the logged message. Default value is false. @var boolean 
+	 */
+	private $htmlLineBreaks = false;
+
 	public function __construct($name = '') {
-	    parent::__construct($name);
-	    $this->requiresLayout = true;
-	    $this->firstAppend = true;
+		parent::__construct($name);
+		$this->firstAppend = true;
 	}
 	
 	public function __destruct() {
-       $this->close();
-   	}
-   	
+		$this->close();
+	}
+
 	public function activateOptions() {
 		$this->closed = false;
 	}
@@ -72,7 +69,7 @@ class LoggerAppenderEcho extends LoggerAppender {
 				echo $this->layout->getFooter();
 			}
 		}
-		$this->closed = true;	 
+		$this->closed = true;
 	}
 
 	public function append(LoggerLoggingEvent $event) {
@@ -81,9 +78,21 @@ class LoggerAppenderEcho extends LoggerAppender {
 				echo $this->layout->getHeader();
 				$this->firstAppend = false;
 			}
-			echo $this->layout->format($event);
+			$text = $this->layout->format($event);
+			
+			if ($this->htmlLineBreaks) {
+				$text = nl2br($text);
+			}
+			echo $text;
 		} 
 	}
+	
+	public function setHtmlLineBreaks($value) {
+		$this->htmlLineBreaks = LoggerOptionConverter::toBoolean($value, false);
+	}
+
+	public function getHtmlLineBreaks() {
+		return $this->htmlLineBreaks;
+	}
 }
 
-?>
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderFile.php b/libraries/log4php.debug/appenders/LoggerAppenderFile.php
index f5d4ca5189283ad320b44ea91e1c91a67edc4e0c..4cd6250b9884b5f4de5629b1c17ca31fb2f5e58d 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderFile.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderFile.php
@@ -18,22 +18,15 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-require_once(LOG4PHP_DIR . '/helpers/LoggerOptionConverter.php');
-
 /**
  * FileAppender appends log events to a file.
  *
- * Configurable parameters for this appender are:
+ * This appender uses a layout.
  * 
- * - layout             - Sets the layout class for this appender
- * - file               - The target file to write to
- * - filename           - The target file to write to
- * - append             - Sets if the appender should append to the end of the file or overwrite content ("true" or "false")
+ * Configurable parameters for this appender are:
+ * - file      - The target file to write to
+ * - filename  - The target file to write to (deprecated, use "file" instead)
+ * - append    - Sets if the appender should append to the end of the file or overwrite content ("true" or "false")
  *
  * An example php file:
  * 
@@ -43,7 +36,7 @@ require_once(LOG4PHP_DIR . '/helpers/LoggerOptionConverter.php');
  * 
  * {@example ../../examples/resources/appender_file.properties 18}
  * 
- * @version $Revision: 883108 $
+ * @version $Revision: 1062665 $
  * @package log4php
  * @subpackage appenders
  */
@@ -53,10 +46,12 @@ class LoggerAppenderFile extends LoggerAppender {
 	 * @var boolean if {@link $file} exists, appends events.
 	 */
 	private $append = true;
+	
 	/**
 	 * @var string the file name used to append events
 	 */
-	protected $fileName;
+	protected $file;
+
 	/**
 	 * @var mixed file resource
 	 */
@@ -64,13 +59,12 @@ class LoggerAppenderFile extends LoggerAppender {
 	
 	public function __construct($name = '') {
 		parent::__construct($name);
-		$this->requiresLayout = true;
 	}
 
 	public function __destruct() {
-       $this->close();
-   	}
-   	
+		$this->close();
+	}
+	
 	public function activateOptions() {
 		$fileName = $this->getFile();
 
@@ -124,31 +118,18 @@ class LoggerAppenderFile extends LoggerAppender {
 	}
 	
 	/**
-	 * Sets and opens the file where the log output will go.
-	 *
-	 * This is an overloaded method. It can be called with:
-	 * - setFile(string $fileName) to set filename.
-	 * - setFile(string $fileName, boolean $append) to set filename and append.
-	 * 
-	 * TODO: remove overloading. Use only file as alias to filename
+	 * Sets the file where the log output will go.
+	 * @param string $file
 	 */
-	public function setFile() {
-		$numargs = func_num_args();
-		$args	 = func_get_args();
-
-		if($numargs == 1 and is_string($args[0])) {
-			$this->setFileName($args[0]);
-		} else if ($numargs >=2 and is_string($args[0]) and is_bool($args[1])) {
-			$this->setFile($args[0]);
-			$this->setAppend($args[1]);
-		}
+	public function setFile($file) {
+		$this->file = $file;
 	}
 	
 	/**
 	 * @return string
 	 */
 	public function getFile() {
-		return $this->getFileName();
+		return $this->file;
 	}
 	
 	/**
@@ -159,20 +140,25 @@ class LoggerAppenderFile extends LoggerAppender {
 	}
 
 	public function setAppend($flag) {
-		$this->append = LoggerOptionConverter::toBoolean($flag, true);		  
+		$this->append = LoggerOptionConverter::toBoolean($flag, true);
 	}
 
+	/**
+	 * Sets the file where the log output will go.
+	 * @param string $fileName
+	 * @deprecated Use setFile() instead.
+	 */
 	public function setFileName($fileName) {
-		$this->fileName = $fileName;
+		$this->setFile($fileName);
 	}
 	
 	/**
 	 * @return string
+	 * @deprecated Use getFile() instead.
 	 */
 	public function getFileName() {
-		return $this->fileName;
+		return $this->getFile();
 	}
 	
 	 
 }
-?>
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderMail.php b/libraries/log4php.debug/appenders/LoggerAppenderMail.php
index 384b0f1703e2581768cc1c7f3605bdd962033f51..ae9ad2a4737545e48dcdcf3373196dac03b669a6 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderMail.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderMail.php
@@ -18,11 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
- 
 /**
  * Appends log events to mail using php function {@link PHP_MANUAL#mail}.
  *
@@ -53,7 +48,7 @@ if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
  *      Tue Sep  8 21:51:06 2009,120 [5485] FATAL root - Some more critical message!
  * </pre>
 
- * @version $Revision: 883108 $
+ * @version $Revision: 1062665 $
  * @package log4php
  * @subpackage appenders
  */
@@ -81,12 +76,11 @@ class LoggerAppenderMail extends LoggerAppender {
 	 */
 	public function __construct($name = '') {
 		parent::__construct($name);
-		$this->requiresLayout = true;
 	}
 
 	public function __destruct() {
-       $this->close();
-   	}
+		$this->close();
+	}
 
 	public function activateOptions() {
 		$this->closed = false;
@@ -134,4 +128,3 @@ class LoggerAppenderMail extends LoggerAppender {
 		}
 	}
 }
-?>
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderMailEvent.php b/libraries/log4php.debug/appenders/LoggerAppenderMailEvent.php
index adf7149791a952e5d5a563f13f03c80dc0d6bf37..5d741affa92b2d389b02783622193d05a43b0737 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderMailEvent.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderMailEvent.php
@@ -18,8 +18,6 @@
  * @package log4php
  */
 
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
 /**
  * Log every events as a separate email.
  * 
@@ -49,7 +47,7 @@ if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
  *      Tue Sep  8 21:51:04 2009,120 [5485] FATAL root - Some critical message!
  * </pre>
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1137177 $
  * @package log4php
  * @subpackage appenders
  */
@@ -80,11 +78,6 @@ class LoggerAppenderMailEvent extends LoggerAppender {
 	 */
 	private $to = null;
 	
-	/**
-	 * @access private
-	 */
-	protected $requiresLayout = true;
-
 	/** @var indiciates if this appender should run in dry mode */
 	private $dry = false;
 	
@@ -98,23 +91,23 @@ class LoggerAppenderMailEvent extends LoggerAppender {
 	}
 
 	public function __destruct() {
-       $this->close();
-   	}
-   	
+		$this->close();
+	}
+	
 	public function activateOptions() {
-	    if (empty($this->layout)) {
-	        throw new LoggerException("LoggerAppenderMailEvent requires layout!");
-	    }
-	    if (empty($this->to)) {
-            throw new LoggerException("LoggerAppenderMailEvent was initialized with empty 'from' ($this->from) or 'to' ($this->to) Adress!");
-        }
-        
-        $sendmail_from = ini_get('sendmail_from');
-        if (empty($this->from) and empty($sendmail_from)) {
-            throw new LoggerException("LoggerAppenderMailEvent requires 'from' or on win32 at least the ini variable sendmail_from!");
-        }
-        
-        $this->closed = false;
+		if (empty($this->layout)) {
+			throw new LoggerException("LoggerAppenderMailEvent requires layout!");
+		}
+		if (empty($this->to)) {
+			throw new LoggerException("LoggerAppenderMailEvent was initialized with empty 'from' ($this->from) or 'to' ($this->to) Adress!");
+		}
+		
+		$sendmail_from = ini_get('sendmail_from');
+		if (empty($this->from) and empty($sendmail_from)) {
+			throw new LoggerException("LoggerAppenderMailEvent requires 'from' or on win32 at least the ini variable sendmail_from!");
+		}
+		
+		$this->closed = false;
 	}
 	
 	public function close() {
@@ -163,20 +156,12 @@ class LoggerAppenderMailEvent extends LoggerAppender {
 		$addHeader = empty($this->from) ? '' : "From: {$this->from}\r\n";
 		
 		if(!$this->dry) {
-			$result = mail($this->to, $this->subject, 
-				$this->layout->getHeader() . $this->layout->format($event) . $this->layout->getFooter($event), 
-				$addHeader);			
-		    if ($result === false) {
-		        // The error message is only printed to stderr as warning. Any idea how to get it?
-		        throw new LoggerException("Error sending mail to '".$this->to."'!");
-		    }
+			$result = mail($this->to, $this->subject, $this->layout->getHeader() . $this->layout->format($event) . $this->layout->getFooter($event), $addHeader);			
 		} else {
-		    echo "DRY MODE OF MAIL APP.: Send mail to: ".$this->to." with additional headers '".trim($addHeader)."' and content: ".$this->layout->format($event);
+			echo "DRY MODE OF MAIL APP.: Send mail to: ".$this->to." with additional headers '".trim($addHeader)."' and content: ".$this->layout->format($event);
 		}
 			
 		ini_set('SMTP', $prevSmtpHost);
 		ini_set('smtp_port', $prevSmtpPort);
 	}
 }
-
-?>
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderMongoDB.php b/libraries/log4php.debug/appenders/LoggerAppenderMongoDB.php
new file mode 100644
index 0000000000000000000000000000000000000000..b44e80ffcca679959072e8211259c62b36ed75b1
--- /dev/null
+++ b/libraries/log4php.debug/appenders/LoggerAppenderMongoDB.php
@@ -0,0 +1,302 @@
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @package log4php
+ */
+ 
+/**
+ * Appender for writing to MongoDB.
+ * 
+ * This class was originally contributed by Vladimir Gorej.
+ * 
+ * @link http://github.com/log4mongo/log4mongo-php Vladimir Gorej's original submission.
+ * @link http://www.mongodb.org/ MongoDB website.
+ * 
+ * @version $Revision: 806678 $
+ * @package log4php
+ * @subpackage appenders
+ * @since 2.1
+ */
+class LoggerAppenderMongoDB extends LoggerAppender {
+	
+	// ******************************************
+	// ** Constants                            **
+	// ******************************************
+	
+	/** Default prefix for the {@link $host}. */	
+	const DEFAULT_MONGO_URL_PREFIX = 'mongodb://';
+	
+	/** Default value for {@link $host}, without a prefix. */
+	const DEFAULT_MONGO_HOST = 'localhost';
+	
+	/** Default value for {@link $port} */
+	const DEFAULT_MONGO_PORT = 27017;
+	
+	/** Default value for {@link $databaseName} */
+	const DEFAULT_DB_NAME = 'log4php_mongodb';
+	
+	/** Default value for {@link $collectionName} */
+	const DEFAULT_COLLECTION_NAME = 'logs';
+	
+	// ******************************************
+	// ** Configurable parameters              **
+	// ******************************************
+	
+	/** Server on which mongodb instance is located. */
+	protected $host;
+	
+	/** Port on which the instance is bound. */
+	protected $port;
+	
+	/** Name of the database to which to log. */
+	protected $databaseName;
+	
+	/** Name of the collection within the given database. */
+	protected $collectionName;
+			
+	/** Username used to connect to the database. */
+	protected $userName;
+	
+	/** Password used to connect to the database. */
+	protected $password;
+	
+	// ******************************************
+	// ** Member variables                     **
+	// ******************************************
+
+	/** 
+	 * Connection to the MongoDB instance.
+	 * @var Mongo
+	 */
+	protected $connection;
+	
+	/** 
+	 * The collection to which log is written. 
+	 * @var MongoCollection
+	 */
+	protected $collection;
+
+	/** 
+	 * Set to true if the appender can append. 
+	 * @todo Maybe we should use $closed here instead? 
+	 */
+	protected $canAppend = false;
+	
+	/** Appender does not require a layout. */
+	protected $requiresLayout = false;
+		
+	public function __construct($name = '') {
+		parent::__construct($name);
+		$this->host = self::DEFAULT_MONGO_URL_PREFIX . self::DEFAULT_MONGO_HOST;
+		$this->port = self::DEFAULT_MONGO_PORT;
+		$this->databaseName = self::DEFAULT_DB_NAME;
+		$this->collectionName = self::DEFAULT_COLLECTION_NAME;
+	}
+	
+	/**
+	 * Setup db connection.
+	 * Based on defined options, this method connects to the database and 
+	 * creates a {@link $collection}. 
+	 *  
+	 * @throws Exception if the attempt to connect to the requested database fails.
+	 */
+	public function activateOptions() {
+		try {
+			$this->connection = new Mongo(sprintf('%s:%d', $this->host, $this->port));
+			$db	= $this->connection->selectDB($this->databaseName);
+			if ($this->userName !== null && $this->password !== null) {
+				$authResult = $db->authenticate($this->userName, $this->password);
+				if ($authResult['ok'] == floatval(0)) {
+					throw new Exception($authResult['errmsg'], $authResult['ok']);
+				}
+			}
+			
+			$this->collection = $db->selectCollection($this->collectionName);												 
+		} catch (Exception $ex) {
+			$this->canAppend = false;
+			throw new LoggerException($ex);
+		} 
+			
+		$this->canAppend = true;
+	}		 
+	
+	/**
+	 * Appends a new event to the mongo database.
+	 * 
+	 * @throws LoggerException If the pattern conversion or the INSERT statement fails.
+	 */
+	public function append(LoggerLoggingEvent $event) {
+		if ($this->canAppend == true && $this->collection != null) {
+			$document = $this->format($event);
+			$this->collection->insert($document);			
+		}
+	}
+	
+	/**
+	 * Converts the logging event into an array which can be logged to mongodb.
+	 * 
+	 * @param LoggerLoggingEvent $event
+	 * @return array The array representation of the logging event.
+	 */
+	protected function format(LoggerLoggingEvent $event) {
+		$timestampSec  = (int) $event->getTimestamp();
+		$timestampUsec = (int) (($event->getTimestamp() - $timestampSec) * 1000000);
+
+		$document = array(
+			'timestamp'  => new MongoDate($timestampSec, $timestampUsec),
+			'level'      => $event->getLevel()->toString(),
+			'thread'     => (int) $event->getThreadName(),
+			'message'    => $event->getMessage(),
+			'loggerName' => $event->getLoggerName() 
+		);	
+
+		$locationInfo = $event->getLocationInformation();
+		if ($locationInfo != null) {
+			$document['fileName']   = $locationInfo->getFileName();
+			$document['method']     = $locationInfo->getMethodName();
+			$document['lineNumber'] = ($locationInfo->getLineNumber() == 'NA') ? 'NA' : (int) $locationInfo->getLineNumber();
+			$document['className']  = $locationInfo->getClassName();
+		}	
+
+		$throwableInfo = $event->getThrowableInformation();
+		if ($throwableInfo != null) {
+			$document['exception'] = $this->formatThrowable($throwableInfo->getThrowable());
+		}
+		
+		return $document;
+	}
+	
+	/**
+	 * Converts an Exception into an array which can be logged to mongodb.
+	 * 
+	 * Supports innner exceptions (PHP >= 5.3)
+	 * 
+	 * @param Exception $ex
+	 * @return array
+	 */
+	protected function formatThrowable(Exception $ex) {
+		$array = array(				
+			'message'    => $ex->getMessage(),
+			'code'       => $ex->getCode(),
+			'stackTrace' => $ex->getTraceAsString(),
+		);
+                        
+		if (method_exists($ex, 'getPrevious') && $ex->getPrevious() !== null) {
+			$array['innerException'] = $this->formatThrowable($ex->getPrevious());
+		}
+			
+		return $array;
+	}
+		
+	/**
+	 * Closes the connection to the logging database
+	 */
+	public function close() {
+		if($this->closed != true) {
+			$this->collection = null;
+			if ($this->connection !== null) {
+				$this->connection->close();
+				$this->connection = null;	
+			}					
+			$this->closed = true;
+		}
+	}
+	
+	public function __destruct() {
+		$this->close();
+	}
+	
+	/** Sets the value of {@link $host} parameter. */
+	public function setHost($host) {
+		if (!preg_match('/^mongodb\:\/\//', $host)) {
+			$host = self::DEFAULT_MONGO_URL_PREFIX . $host;
+		}			
+		$this->host = $host;				
+	}
+		
+	/** Returns the value of {@link $host} parameter. */
+	public function getHost() {
+		return $this->host;
+	}
+		
+	/** Sets the value of {@link $port} parameter. */
+	public function setPort($port) {
+		$this->port = $port;
+	}
+		
+	/** Returns the value of {@link $port} parameter. */
+	public function getPort() {
+		return $this->port;
+	}
+		
+	/** Sets the value of {@link $databaseName} parameter. */
+	public function setDatabaseName($databaseName) {
+		$this->databaseName = $databaseName;
+	}
+		
+	/** Returns the value of {@link $databaseName} parameter. */
+	public function getDatabaseName() {
+		return $this->databaseName;
+	}
+	
+	/** Sets the value of {@link $collectionName} parameter. */
+	public function setCollectionName($collectionName) {
+		$this->collectionName = $collectionName;
+	}
+		
+	/** Returns the value of {@link $collectionName} parameter. */
+	public function getCollectionName() {
+		return $this->collectionName;
+	}
+		
+	/** Sets the value of {@link $userName} parameter. */
+	public function setUserName($userName) {
+		$this->userName = $userName;
+	}
+	
+	/** Returns the value of {@link $userName} parameter. */
+	public function getUserName() {
+		return $this->userName;
+	}
+		
+	/** Sets the value of {@link $password} parameter. */
+	public function setPassword($password) {
+		$this->password = $password;
+	}
+		
+	/** Returns the value of {@link $password} parameter. */
+	public function getPassword() {
+		return $this->password;
+	}
+	
+	/** 
+	 * Returns the mongodb connection.
+	 * @return Mongo
+	 */
+	public function getConnection() {
+		return $this->connection;
+	}
+	
+	/** 
+	 * Returns the active mongodb collection.
+	 * @return MongoCollection
+	 */
+	public function getCollection() {
+		return $this->collection;
+	}
+}
+?>
\ No newline at end of file
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderNull.php b/libraries/log4php.debug/appenders/LoggerAppenderNull.php
index 61480286ae6d6169ab3b02b443898047119aada0..313a104026d3273b60b8df0a66124f69f6b4b853 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderNull.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderNull.php
@@ -18,11 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
 /**
  * A NullAppender merely exists, it never outputs a message to any device.	
  *
@@ -34,7 +29,7 @@ if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
  * 
  * {@example ../../examples/resources/appender_null.properties 18}
  * 
- * @version $Revision: 883108 $
+ * @version $Revision: 1059292 $
  * @package log4php
  * @subpackage appenders
  */
@@ -43,9 +38,9 @@ class LoggerAppenderNull extends LoggerAppender {
 	protected $requiresLayout = false;
 	
 	public function __destruct() {
-       $this->close();
-   	}
-   	
+		$this->close();
+	}
+	
 	public function activateOptions() {
 		$this->closed = false;
 	}
@@ -63,4 +58,3 @@ class LoggerAppenderNull extends LoggerAppender {
 	}
 }
 
-?>
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderPDO.php b/libraries/log4php.debug/appenders/LoggerAppenderPDO.php
index 8fadd003a40deecf8483eb9af005dad2033d5f77..349276f2b8ecb96482ce4720f633eb59bf5b09b5 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderPDO.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderPDO.php
@@ -46,251 +46,278 @@
  */
 class LoggerAppenderPDO extends LoggerAppender {
 
-    /** Create the log table if it does not exists (optional).
-     * @var string */
+	/** 
+	 * Create the log table if it does not exists (optional).
+	 * @var string 
+	 */
 	private $createTable = true;
-    
-    /** Database user name.
-     * @var string */
-    private $user = '';
-    
-    /** Database password
-     * @var string */
-    private $password = '';
-    
-    /** DSN string for enabling a connection.
-     * @var string */
-    private $dsn;
-    
-    /** A {@link LoggerPatternLayout} string used to format a valid insert query.
-     * @deprecated Use {@link $insertSql} and {@link $insertPattern} which properly handle quotes in the messages!
-     * @var string */
-    private $sql;
-    
-    /** Can be set to a complete insert statement with ? that are replaced using {@link insertPattern}.
-     * @var string */
-    private $insertSql = "INSERT INTO __TABLE__ (timestamp, logger, level, message, thread, file, line) VALUES (?,?,?,?,?,?,?)";
+	
+	/** 
+	 * Database user name.
+	 * @var string 
+	 */
+	private $user = '';
+	
+	/** 
+	 * Database password
+	 * @var string 
+	 */
+	private $password = '';
+	
+	/** 
+	 * DSN string for enabling a connection.
+	 * @var string 
+	 */
+	private $dsn;
+	
+	/** 
+	 * A {@link LoggerPatternLayout} string used to format a valid insert query.
+	 * @deprecated Use {@link $insertSql} and {@link $insertPattern} which properly handle quotes in the messages!
+	 * @var string 
+	 */
+	private $sql;
+	
+	/** 
+	 * Can be set to a complete insert statement with ? that are replaced using {@link insertPattern}.
+	 * @var string 
+	 */
+	private $insertSql = "INSERT INTO __TABLE__ (timestamp, logger, level, message, thread, file, line) VALUES (?,?,?,?,?,?,?)";
 
-    /** A comma separated list of {@link LoggerPatternLayout} format strings that replace the "?" in {@link $sql}.
-     * @var string */
-    private $insertPattern = "%d,%c,%p,%m,%t,%F,%L";
+	/** 
+	 * A comma separated list of {@link LoggerPatternLayout} format strings that replace the "?" in {@link $sql}.
+	 * @var string 
+	 */
+	private $insertPattern = "%d,%c,%p,%m,%t,%F,%L";
 
-    /** Table name to write events. Used only for CREATE TABLE if {@link $createTable} is true.
-     * @var string */
-    private $table = 'log4php_log';
-    
-    /** The PDO instance.
-     * @var PDO */
-    private $db = null;
-    
-    /** Prepared statement for the INSERT INTO query.
-     * @var PDOStatement */
-    private $preparedInsert;
+	/** 
+	 * Table name to write events. Used only for CREATE TABLE if {@link $createTable} is true.
+	 * @var string 
+	 */
+	private $table = 'log4php_log';
+	
+	/** 
+	 * The PDO instance.
+	 * @var PDO 
+	 */
+	private $db = null;
+	
+	/** 
+	 * Prepared statement for the INSERT INTO query.
+	 * @var PDOStatement 
+	 */
+	private $preparedInsert;
 
-    /** Set in activateOptions() and later used in append() to check if all conditions to append are true.
-     * @var boolean */
-    private $canAppend = true;
-    
-    /**
-     * Constructor.
-     * This apender doesn't require a layout.
-     * @param string $name appender name
-     */
-    public function __construct($name = '') {
-        parent::__construct($name);
-        $this->requiresLayout = false;
-    }
-    
+	/** 
+	 * Set in activateOptions() and later used in append() to check if all conditions to append are true.
+	 * @var boolean 
+	 */
+	private $canAppend = true;
+	
+	/**
+	 * This appender does not require a layout.
+	 */
+	protected $requiresLayout = false;
+	
+	/**
+	 * Constructor.
+	 * This apender doesn't require a layout.
+	 * @param string $name appender name
+	 */
+	public function __construct($name = '') {
+		parent::__construct($name);
+	}
+	
 	public function __destruct() {
-       $this->close();
+	   $this->close();
    	}
    	
-    /**
-     * Setup db connection.
-     * Based on defined options, this method connects to db defined in {@link $dsn}
-     * and creates a {@link $table} table if {@link $createTable} is true.
-     * @return boolean true if all ok.
-     * @throws a PDOException if the attempt to connect to the requested database fails.
-     */
-    public function activateOptions() {
-        try {
-        	if($this->user === null) {
-	           	$this->db = new PDO($this->dsn);
-    	   } else if($this->password === null) {
-    	       $this->db = new PDO($this->dsn, $this->user);
-    	   } else {
-    	       $this->db = new PDO($this->dsn,$this->user,$this->password);
-    	   }
-    	   $this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-    	
-            // test if log table exists
-            try {
-                $result = $this->db->query('SELECT * FROM ' . $this->table . ' WHERE 1 = 0');
-            } catch (PDOException $e) {
-                // It could be something else but a "no such table" is the most likely
-                $result = false;
-            }
-            
-            // create table if necessary
-            if ($result == false and $this->createTable) {
-                // The syntax should at least be compatible with MySQL, PostgreSQL, SQLite and Oracle.
-                $query = "CREATE TABLE {$this->table} (".
-                            "timestamp varchar(32)," .
-            				"logger varchar(64)," .
-            										"level varchar(32)," .
-            				"message varchar(9999)," .
-            										"thread varchar(32)," .
-            				"file varchar(255)," .
-            				"line varchar(6))";
-                $result = $this->db->query($query);
-            }
-        } catch (PDOException $e) {
-            $this->canAppend = false;
-            throw new LoggerException($e);
-        }
-        
-        $this->layout = new LoggerLayoutPattern();
-        
-        //
-        // Keep compatibility to legacy option $sql which already included the format patterns!
-        //
-        if (empty($this->sql)) {
-            // new style with prepared Statment and $insertSql and $insertPattern
-            // Maybe the tablename has to be substituted.
-            $this->insertSql = preg_replace('/__TABLE__/', $this->table, $this->insertSql);
-            $this->preparedInsert = $this->db->prepare($this->insertSql);
-            $this->layout->setConversionPattern($this->insertPattern);
-        } else {
-            // Old style with format strings in the $sql query should be used.
-        $this->layout->setConversionPattern($this->sql);
-        }
+	/**
+	 * Setup db connection.
+	 * Based on defined options, this method connects to db defined in {@link $dsn}
+	 * and creates a {@link $table} table if {@link $createTable} is true.
+	 * @return boolean true if all ok.
+	 * @throws a PDOException if the attempt to connect to the requested database fails.
+	 */
+	public function activateOptions() {
+		try {
+			if($this->user === null) {
+				$this->db = new PDO($this->dsn);
+			} else if($this->password === null) {
+				$this->db = new PDO($this->dsn, $this->user);
+			} else {
+				$this->db = new PDO($this->dsn,$this->user,$this->password);
+			}
+			$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
+			
+			// test if log table exists
+			try {
+				$result = $this->db->query('SELECT * FROM ' . $this->table . ' WHERE 1 = 0');
+				$result->closeCursor(); 
+			} catch (PDOException $e) {
+				// It could be something else but a "no such table" is the most likely
+				$result = false;
+			}
+			
+			// create table if necessary
+			if ($result == false and $this->createTable) {
+				// The syntax should at least be compatible with MySQL, PostgreSQL, SQLite and Oracle.
+				$query = "CREATE TABLE {$this->table} (".
+							"timestamp varchar(32)," .
+							"logger varchar(64)," .
+							"level varchar(32)," .
+							"message varchar(9999)," .
+							"thread varchar(32)," .
+							"file varchar(255)," .
+							"line varchar(6))";
+				$result = $this->db->query($query);
+			}
+		} catch (PDOException $e) {
+			$this->canAppend = false;
+			throw new LoggerException($e);
+		}
+		
+		$this->layout = new LoggerLayoutPattern();
+		
+		//
+		// Keep compatibility to legacy option $sql which already included the format patterns!
+		//
+		if (empty($this->sql)) {
+			// new style with prepared Statment and $insertSql and $insertPattern
+			// Maybe the tablename has to be substituted.
+			$this->insertSql = preg_replace('/__TABLE__/', $this->table, $this->insertSql);
+			$this->preparedInsert = $this->db->prepare($this->insertSql);
+			$this->layout->setConversionPattern($this->insertPattern);
+		} else {
+			// Old style with format strings in the $sql query should be used.
+		$this->layout->setConversionPattern($this->sql);
+		}
 
-        $this->canAppend = true;
-        return true;
-    }
-    
-    /**
-     * Appends a new event to the database.
-     * 
-     * @throws LoggerException      If the pattern conversion or the INSERT statement fails.
-     */
-    public function append(LoggerLoggingEvent $event) {
-        // TODO: Can't activateOptions() simply throw an Exception if it encounters problems?
-        if ( ! $this->canAppend) return;
+		$this->canAppend = true;
+		return true;
+	}
+	
+	/**
+	 * Appends a new event to the database.
+	 * 
+	 * @throws LoggerException If the pattern conversion or the INSERT statement fails.
+	 */
+	public function append(LoggerLoggingEvent $event) {
+		// TODO: Can't activateOptions() simply throw an Exception if it encounters problems?
+		if ( ! $this->canAppend) return;
 
-            try {
-            if (empty($this->sql)) {
-                // new style with prepared statement
-                $params = $this->layout->formatToArray($event);
-                $this->preparedInsert->execute($params);
-            } else {
-                // old style
-                $query = $this->layout->format($event);
-                $this->db->exec($query);
-            }
-            } catch (Exception $e) {
-                throw new LoggerException($e);
-            }
-        }
-    
-    /**
-     * Closes the connection to the logging database
-     */
-    public function close() {
-    	if($this->closed != true) {
-        	if ($this->db !== null) {
-            	$db = null;
-        	}
-        	$this->closed = true;
-    	}
-    }
-    
-    /**
-     * Sets the username for this connection. 
-     * Defaults to ''
-     */
-    public function setUser($user) {
-        $this->user = $user;
-    }
-    
-    /**
-     * Sets the password for this connection. 
-     * Defaults to ''
-     */
-    public function setPassword($password) {
-        $this->password = $password;
-    }
-    
-    /**
-     * Indicator if the logging table should be created on startup,
-     * if its not existing.
-     */
-    public function setCreateTable($flag) {
-        $this->createTable = LoggerOptionConverter::toBoolean($flag, true);
-    }
+			try {
+			if (empty($this->sql)) {
+				// new style with prepared statement
+				$params = $this->layout->formatToArray($event);
+				$this->preparedInsert->execute($params);
+			} else {
+				// old style
+				$query = $this->layout->format($event);
+				$this->db->exec($query);
+			}
+			} catch (Exception $e) {
+				throw new LoggerException($e);
+			}
+		}
+	
+	/**
+	 * Closes the connection to the logging database
+	 */
+	public function close() {
+		if($this->closed != true) {
+			if ($this->db !== null) {
+				$this->db = null;
+			}
+			$this->closed = true;
+		}
+	}
+	
+	/**
+	 * Sets the username for this connection. 
+	 * Defaults to ''
+	 */
+	public function setUser($user) {
+		$this->user = $user;
+	}
+	
+	/**
+	 * Sets the password for this connection. 
+	 * Defaults to ''
+	 */
+	public function setPassword($password) {
+		$this->password = $password;
+	}
+	
+	/**
+	 * Indicator if the logging table should be created on startup,
+	 * if its not existing.
+	 */
+	public function setCreateTable($flag) {
+		$this->createTable = LoggerOptionConverter::toBoolean($flag, true);
+	}
    
    	/**
-     * Sets the SQL string into which the event should be transformed.
-     * Defaults to:
-     * 
-     * INSERT INTO $this->table 
-     * ( timestamp, logger, level, message, thread, file, line) 
-     * VALUES 
-     * ('%d','%c','%p','%m','%t','%F','%L')
-     * 
-     * It's not necessary to change this except you have customized logging'
-     *
-     * @deprecated See {@link setInsertSql} and {@link setInsertPattern}.
-     */
-    public function setSql($sql) {
-        $this->sql = $sql;    
-    }
-    
-    /**
-     * Sets the SQL INSERT string to use with {@link $insertPattern}.
-     *
-     * @param $sql          A complete INSERT INTO query with "?" that gets replaced.
-     */
-    public function setInsertSql($sql) {
-        $this->insertSql = $sql;
-    }
+	 * Sets the SQL string into which the event should be transformed.
+	 * Defaults to:
+	 * 
+	 * INSERT INTO $this->table 
+	 * ( timestamp, logger, level, message, thread, file, line) 
+	 * VALUES 
+	 * ('%d','%c','%p','%m','%t','%F','%L')
+	 * 
+	 * It's not necessary to change this except you have customized logging'
+	 *
+	 * @deprecated See {@link setInsertSql} and {@link setInsertPattern}.
+	 */
+	public function setSql($sql) {
+		$this->sql = $sql;	
+	}
+	
+	/**
+	 * Sets the SQL INSERT string to use with {@link $insertPattern}.
+	 *
+	 * @param $sql		  A complete INSERT INTO query with "?" that gets replaced.
+	 */
+	public function setInsertSql($sql) {
+		$this->insertSql = $sql;
+	}
 
-    /**
-     * Sets the {@link LoggerLayoutPattern} format strings for {@link $insertSql}.
-     *
-     * It's not necessary to change this except you have customized logging.
-     *
-     * @param $pattern          Comma separated format strings like "%p,%m,%C"
-     */
-    public function setInsertPattern($pattern) {
-        $this->insertPattern = $pattern;
-    }
+	/**
+	 * Sets the {@link LoggerLayoutPattern} format strings for {@link $insertSql}.
+	 *
+	 * It's not necessary to change this except you have customized logging.
+	 *
+	 * @param $pattern		  Comma separated format strings like "%p,%m,%C"
+	 */
+	public function setInsertPattern($pattern) {
+		$this->insertPattern = $pattern;
+	}
 
-    /**
-     * Sets the tablename to which this appender should log.
-     * Defaults to log4php_log
-     */
-    public function setTable($table) {
-        $this->table = $table;
-    }
-    
-    /**
-     * Sets the DSN string for this connection. In case of
-     * SQLite it could look like this: 'sqlite:appenders/pdotest.sqlite'
-     */
-    public function setDSN($dsn) {
-        $this->dsn = $dsn;
-    }
-    
-    /**
-     * Sometimes databases allow only one connection to themselves in one thread.
-     * SQLite has this behaviour. In that case this handle is needed if the database
-     * must be checked for events.
-     *
-     * @return PDO
-     */
-    public function getDatabaseHandle() {
-        return $this->db;
-    }
+	/**
+	 * Sets the tablename to which this appender should log.
+	 * Defaults to log4php_log
+	 */
+	public function setTable($table) {
+		$this->table = $table;
+	}
+	
+	/**
+	 * Sets the DSN string for this connection. In case of
+	 * SQLite it could look like this: 'sqlite:appenders/pdotest.sqlite'
+	 */
+	public function setDSN($dsn) {
+		$this->dsn = $dsn;
+	}
+	
+	/**
+	 * Sometimes databases allow only one connection to themselves in one thread.
+	 * SQLite has this behaviour. In that case this handle is needed if the database
+	 * must be checked for events.
+	 *
+	 * @return PDO
+	 */
+	public function getDatabaseHandle() {
+		return $this->db;
+	}
 }
 
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderPhp.php b/libraries/log4php.debug/appenders/LoggerAppenderPhp.php
index eee2113ae85d49fd715f5a93b942b729be42e5b2..cd950ff42e8303449454a2a9698d6dc6324fc130 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderPhp.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderPhp.php
@@ -18,13 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-require_once(LOG4PHP_DIR . '/LoggerLevel.php');
-
 /**
  * Log events using php {@link PHP_MANUAL#trigger_error} function and a {@link LoggerLayoutTTCC} default layout.
  *
@@ -41,7 +34,7 @@ require_once(LOG4PHP_DIR . '/LoggerLevel.php');
  * 
  * {@example ../../examples/resources/appender_php.properties 18}
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1062665 $
  * @package log4php
  * @subpackage appenders
  */ 
@@ -49,12 +42,11 @@ class LoggerAppenderPhp extends LoggerAppender {
 
 	public function __construct($name = '') {
 		parent::__construct($name);
-		$this->requiresLayout = true;
 	}
 	
 	public function __destruct() {
-       $this->close();
-   	}
+		$this->close();
+	}
 	
 	public function activateOptions() {
 		$this->closed = false;
@@ -77,4 +69,3 @@ class LoggerAppenderPhp extends LoggerAppender {
 		}
 	}
 }
-?>
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderRollingFile.php b/libraries/log4php.debug/appenders/LoggerAppenderRollingFile.php
index a1135f6096fbaca07d007722b03603e5d560d088..f6a9c322264ca14dd5130362a06e0d2c419a3a2e 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderRollingFile.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderRollingFile.php
@@ -18,28 +18,21 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
- 
-require_once(LOG4PHP_DIR . '/appenders/LoggerAppenderFile.php');
-
 /**
  * LoggerAppenderRollingFile extends LoggerAppenderFile to backup the log files 
  * when they reach a certain size.
+ * 
+ * This appender uses a layout.
  *
  * Parameters are:
- *
- * - layout            - Sets the layout class for this appender
  * - file              - The target file to write to
- * - filename          - The target file to write to
+ * - filename          - The target file to write to (deprecated, use "file" instead).
  * - append            - Sets if the appender should append to the end of the file or overwrite content ("true" or "false")
  * - maxBackupIndex    - Set the maximum number of backup files to keep around (int)
  * - maxFileSize       - Set the maximum size that the output file is allowed to
  *                       reach before being rolled over to backup files.
  *                       Suffixes like "KB", "MB" or "GB" are allowed, f. e. "10KB" is interpreted as 10240
- * - maximumFileSize   - Alias to MaxFileSize
+ * - maximumFileSize   - Alias to maxFileSize (deprecated, use "maxFileSize" instead)
  *
  * <p>Contributors: Sergio Strampelli.</p>
  *
@@ -49,7 +42,7 @@ require_once(LOG4PHP_DIR . '/appenders/LoggerAppenderFile.php');
  *
  * {@example ../../examples/resources/appender_socket.properties 18}
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1134244 $
  * @package log4php
  * @subpackage appenders
  */
@@ -89,14 +82,13 @@ class LoggerAppenderRollingFile extends LoggerAppenderFile {
 	
 	/**
 	 * @var string the filename expanded
-	 * @access private
 	 */
 	private $expandedFileName = null;
 
 	public function __destruct() {
-       parent::__destruct();
-   	}
-   	
+		parent::__destruct();
+	}
+	
 	/**
 	 * Returns the value of the MaxBackupIndex option.
 	 * @return integer 
@@ -110,7 +102,7 @@ class LoggerAppenderRollingFile extends LoggerAppenderFile {
 	 * before being rolled over to backup files.
 	 * @return integer
 	 */
-	private function getMaximumFileSize() {
+	public function getMaximumFileSize() {
 		return $this->maxFileSize;
 	}
 
@@ -121,15 +113,19 @@ class LoggerAppenderRollingFile extends LoggerAppenderFile {
 	 * Moreover, File is renamed File.1 and closed. A new File is created to receive further log output.
 	 * 
 	 * <p>If MaxBackupIndex is equal to zero, then the File is truncated with no backup files created.
+	 * 
+	 * Rollover must be called while the file is locked so that it is safe for concurrent access. 
 	 */
 	private function rollOver() {
 		// If maxBackups <= 0, then there is no file renaming to be done.
 		if($this->maxBackupIndex > 0) {
 			$fileName = $this->getExpandedFileName();
+
 			// Delete the oldest file, to keep Windows happy.
 			$file = $fileName . '.' . $this->maxBackupIndex;
 			if(is_writable($file))
 				unlink($file);
+
 			// Map {(maxBackupIndex - 1), ..., 2, 1} to {maxBackupIndex, ..., 3, 2}
 			for($i = $this->maxBackupIndex - 1; $i >= 1; $i--) {
 				$file = $fileName . "." . $i;
@@ -139,26 +135,22 @@ class LoggerAppenderRollingFile extends LoggerAppenderFile {
 				}
 			}
 	
-			$this->close();
-	
-			// Rename fileName to fileName.1
-			$target = $fileName . ".1";
-			$file = $fileName;
-			rename($file, $target);
+			// Backup the active file
+			copy($fileName, "$fileName.1");
 		}
 		
-		//unset($this->fp);
-		$this->activateOptions();
-		$this->setFile($fileName, false);
+		// Truncate the active file
+		ftruncate($this->fp, 0);
+		rewind($this->fp);
 	}
 	
-	public function setFileName($fileName) {
-		$this->fileName = $fileName;
+	public function setFile($fileName) {
+		$this->file = $fileName;
 		// As LoggerAppenderFile does not create the directory, it has to exist.
 		// realpath() fails if the argument does not exist so the filename is separated.
 		$this->expandedFileName = realpath(dirname($fileName));
 		if ($this->expandedFileName === false) throw new Exception("Directory of $fileName does not exist!");
-		$this->expandedFileName .= '/'.basename($fileName);
+		$this->expandedFileName .= DIRECTORY_SEPARATOR . basename($fileName);
 	}
 
 
@@ -194,7 +186,7 @@ class LoggerAppenderRollingFile extends LoggerAppenderFile {
 	/**
 	 * Set the maximum size that the output file is allowed to reach
 	 * before being rolled over to backup files.
-	 * <p>In configuration files, the <b>MaxFileSize</b> option takes an
+	 * <p>In configuration files, the <b>maxFileSize</b> option takes an
 	 * long integer in the range 0 - 2^63. You can specify the value
 	 * with the suffixes "KB", "MB" or "GB" so that the integer is
 	 * interpreted being expressed respectively in kilobytes, megabytes
@@ -225,14 +217,38 @@ class LoggerAppenderRollingFile extends LoggerAppenderFile {
 		return $this->maxFileSize;
 	}
 
+	public function append(LoggerLoggingEvent $event) {
+		if($this->fp and $this->layout !== null) {
+			if(flock($this->fp, LOCK_EX)) {
+				fwrite($this->fp, $this->layout->format($event));
+
+				// Stats cache must be cleared, otherwise filesize() returns cached results
+				clearstatcache();
+				
+				// Rollover if needed
+				if (filesize($this->expandedFileName) > $this->maxFileSize) {
+					$this->rollOver();
+				}
+				
+				flock($this->fp, LOCK_UN);
+			} else {
+				$this->closed = true;
+			}
+		} 
+	}
+	
 	/**
-	 * @param LoggerLoggingEvent $event
+	 * @return Returns the maximum number of backup files to keep around.
 	 */
-	public function append(LoggerLoggingEvent $event) {
-		parent::append($event);
-		if(ftell($this->fp) > $this->getMaximumFileSize()) {
-			$this->rollOver();
-		}
+	public function getMaxBackupIndex() {
+		return $this->maxBackupIndex;
+	}
+	
+	/**
+	 * @return Returns the maximum size that the output file is allowed to reach
+	 * before being rolled over to backup files.
+	 */
+	public function getMaxFileSize() {
+		return $this->maxFileSize;
 	}
 }
-?>
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderSocket.php b/libraries/log4php.debug/appenders/LoggerAppenderSocket.php
index cac55456afe8b1a4711ebfb22d5216548b425b4c..78477b8a3bcf987436247b3cf03d23953623fabb 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderSocket.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderSocket.php
@@ -18,17 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-define('LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_PORT',       4446);
-define('LOG4PHP_LOGGER_APPENDER_SOCKET_DEFAULT_TIMEOUT',    30);
-
-require_once(LOG4PHP_DIR . '/helpers/LoggerOptionConverter.php');
-require_once(LOG4PHP_DIR . '/LoggerLayout.php');
-
 /**
  * Serialize events and send them to a network socket.
  *
@@ -51,15 +40,19 @@ require_once(LOG4PHP_DIR . '/LoggerLayout.php');
  * 
  * {@example ../../examples/resources/appender_socket.properties 18}
  * 
- * @version $Revision: 883108 $
+ * @version $Revision: 1062667 $
  * @package log4php
  * @subpackage appenders
  */ 
 class LoggerAppenderSocket extends LoggerAppender {
 
+	/**
+	 * This appender does not require a layout.
+	 */
+	protected $requiresLayout = false;
+	
 	/**
 	 * @var mixed socket connection resource
-	 * @access private
 	 */
 	private $sp = false;
 	
@@ -98,7 +91,6 @@ class LoggerAppenderSocket extends LoggerAppender {
 
 	/**
 	 * @var LoggerXmlLayout
-	 * @access private
 	 */
 	private $xmlLayout = null;
 	
@@ -106,9 +98,9 @@ class LoggerAppenderSocket extends LoggerAppender {
 	private $dry = false;
 	
 	public function __destruct() {
-       $this->close();
-   	}
-   	
+		$this->close();
+	}
+	
 	/**
 	 * Create a socket connection using defined parameters
 	 */
@@ -116,7 +108,7 @@ class LoggerAppenderSocket extends LoggerAppender {
 		if(!$this->dry) {
 			$this->sp = @fsockopen($this->getRemoteHost(), $this->getPort(), $errno, $errstr, $this->getTimeout());
 			if ($this->sp === false) {
-			    throw new LoggerException("Could not open socket to ".$this->getRemoteHost().":".$this->getPort().": $errstr ($errno)");
+				throw new LoggerException("Could not open socket to ".$this->getRemoteHost().":".$this->getPort().": $errstr ($errno)");
 			}
 		}
 		if($this->getUseXml()) {
@@ -129,7 +121,7 @@ class LoggerAppenderSocket extends LoggerAppender {
 				$this->xmlLayout->activateOptions();
 			}			 
 		}
-        $this->closed = false;
+		$this->closed = false;
 	}
 	
 	public function close() {
@@ -252,22 +244,20 @@ class LoggerAppenderSocket extends LoggerAppender {
 				if(!$this->dry) {
 					fwrite($this->sp, $sEvent, strlen($sEvent));
 				} else {
-				    echo "DRY MODE OF SOCKET APPENDER: ".$sEvent;
+					echo "DRY MODE OF SOCKET APPENDER: ".$sEvent;
 				}
 			} else {
 				if(!$this->dry) {
 					fwrite($this->sp, $this->xmlLayout->format($event));
 				} else {
-				    echo "DRY MODE OF SOCKET APPENDER: ".$this->xmlLayout->format($event);
+					echo "DRY MODE OF SOCKET APPENDER: ".$this->xmlLayout->format($event);
 				}
-			}			 
+			}
 
 			// not sure about it...
 			if(!$this->dry) {
 				fflush($this->sp);
 			}
-		} 
+		}
 	}
 }
-
-?>
diff --git a/libraries/log4php.debug/appenders/LoggerAppenderSyslog.php b/libraries/log4php.debug/appenders/LoggerAppenderSyslog.php
index 034199a4e9b200d9d94ba0c474385dc0618f84a6..9b0b42a38757f897eb37f25cc94719c7c49cbb5a 100644
--- a/libraries/log4php.debug/appenders/LoggerAppenderSyslog.php
+++ b/libraries/log4php.debug/appenders/LoggerAppenderSyslog.php
@@ -18,13 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-require_once(LOG4PHP_DIR . '/LoggerLevel.php');
-
 /**
  * Log events using php {@link PHP_MANUAL#syslog} function.
  *
@@ -47,6 +40,7 @@ require_once(LOG4PHP_DIR . '/LoggerLevel.php');
  * - <b>ERROR > level >= WARN</b> to LOG_WARNING
  * - <b>WARN  > level >= INFO</b> to LOG_INFO
  * - <b>INFO  > level >= DEBUG</b> to LOG_DEBUG
+ * - <b>DEBUG > level >= TRACE</b> to LOG_DEBUG
  *
  * An example:
  *
@@ -54,7 +48,7 @@ require_once(LOG4PHP_DIR . '/LoggerLevel.php');
  *
  * {@example ../../examples/resources/appender_syslog.properties 18}
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1062665 $
  * @package log4php
  * @subpackage appenders
  */ 
@@ -95,7 +89,7 @@ class LoggerAppenderSyslog extends LoggerAppender {
 	 * If it is necessary to define logging priority in the .properties-file,
 	 * set this variable to "true".
 	 *
-	 * @var const int  value indicating whether the priority of the message is defined in the .properties-file
+	 * @var const int value indicating whether the priority of the message is defined in the .properties-file
 	 *				   (or properties-array)
 	 */
 	private $_overridePriority;
@@ -105,14 +99,13 @@ class LoggerAppenderSyslog extends LoggerAppender {
 
 	public function __construct($name = '') {
 		parent::__construct($name);
-		$this->requiresLayout = true;
 	}
 
 	public function __destruct() {
-       $this->close();
-   	}
-   	
-   	public function setDry($dry) {
+		$this->close();
+	}
+	
+	public function setDry($dry) {
 		$this->dry = $dry;
 	}
 	
@@ -151,7 +144,7 @@ class LoggerAppenderSyslog extends LoggerAppender {
 	 * @param bool Override priority
 	 */
 	public function setOverridePriority($overridePriority) {
-		$this->_overridePriority = $overridePriority;							
+		$this->_overridePriority = $overridePriority;
 	} 
 	
 	/**
@@ -161,8 +154,8 @@ class LoggerAppenderSyslog extends LoggerAppender {
 	 *
 	 * @param string	$option
 	 */
-	public function setOption($option) {	  
-		$this->_option = $option;		
+	public function setOption($option) {
+		$this->_option = $option;
 	}
 	
 	public function activateOptions() {
@@ -209,12 +202,13 @@ class LoggerAppenderSyslog extends LoggerAppender {
 					syslog(LOG_INFO, $message);
 				} else if ($level->isGreaterOrEqual(LoggerLevel::getLevelDebug())) {
 					syslog(LOG_DEBUG, $message);
+				} else if ($level->isGreaterOrEqual(LoggerLevel::getLevelTrace())) {
+					syslog(LOG_DEBUG, $message);	// No trace level in syslog
 				}
 			}
 			closelog();
 		} else {
-		      echo "DRY MODE OF SYSLOG APPENDER: ".$message;
+			echo "DRY MODE OF SYSLOG APPENDER: ".$message;
 		}
 	}
 }
-?>
diff --git a/libraries/log4php.debug/config/LoggerPropertyGetter.php b/libraries/log4php.debug/config/LoggerPropertyGetter.php
deleted file mode 100644
index 9f4a380d0ae62678aa68a29a45fe8034e4d44ca5..0000000000000000000000000000000000000000
--- a/libraries/log4php.debug/config/LoggerPropertyGetter.php
+++ /dev/null
@@ -1,37 +0,0 @@
-<?php
-/**
- * log4php is a PHP port of the log4j java logging package.
- * 
- * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
- * <p>Design, strategies and part of the methods documentation are developed by log4j team 
- * (Ceki Gülcü as log4j project founder and 
- * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
- *
- * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
- * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
- *
- * <p>This software is published under the terms of the LGPL License
- * a copy of which has been included with this distribution in the LICENSE file.</p>
- * 
- * @package log4php
- * @subpackage config
- */
-
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-/**
- * @author VxR <vxr@vxr.it>
- * @version $Revision: 1.2 $
- * @package log4php
- * @subpackage config
- * @since 0.5
- * @todo Ehm... try to guess...
- */
-class LoggerPropertyGetter {
-
-}
-
-?>
\ No newline at end of file
diff --git a/libraries/log4php.debug/config/LoggerPropertySetter.php b/libraries/log4php.debug/config/LoggerPropertySetter.php
deleted file mode 100644
index 08e3f05db93801eb21cbb434474aea3a496503dc..0000000000000000000000000000000000000000
--- a/libraries/log4php.debug/config/LoggerPropertySetter.php
+++ /dev/null
@@ -1,161 +0,0 @@
-<?php
-/**
- * log4php is a PHP port of the log4j java logging package.
- * 
- * <p>This framework is based on log4j (see {@link http://jakarta.apache.org/log4j log4j} for details).</p>
- * <p>Design, strategies and part of the methods documentation are developed by log4j team 
- * (Ceki Gülcü as log4j project founder and 
- * {@link http://jakarta.apache.org/log4j/docs/contributors.html contributors}).</p>
- *
- * <p>PHP port, extensions and modifications by VxR. All rights reserved.<br>
- * For more information, please see {@link http://www.vxr.it/log4php/}.</p>
- *
- * <p>This software is published under the terms of the LGPL License
- * a copy of which has been included with this distribution in the LICENSE file.</p>
- * 
- * @package log4php
- * @subpackage config
- */
-
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-require_once(LOG4PHP_DIR . '/LoggerLog.php');
-require_once(LOG4PHP_DIR . '/helpers/LoggerOptionConverter.php');
-
-/**
- * General purpose Object property setter. Clients repeatedly invokes
- * {@link setProperty()} in order to invoke setters
- * on the Object specified in the constructor.
- *  
- * Usage:
- * <code>
- * $ps = new LoggerPropertySetter($anObject);
- * $ps->set("name", "Joe");
- * $ps->set("age", 32);
- * $ps->set("isMale", true);
- * </code>
- * will cause the invocations 
- * <code>
- * $anObject->setName("Joe");
- * $anObject->setAge(32);
- * $anObject->setMale(true)
- * </code>
- * if such methods exist.
- *  
- * @author VxR <vxr@vxr.it>
- * @version $Revision: 1.4 $
- * @package log4php
- * @subpackage config
- * @since 0.5
- */
-class LoggerPropertySetter {
-
-    /**
-     * @var object the target object
-     * @access private
-     */
-    var $obj;
-  
-    /**
-     * Create a new LoggerPropertySetter for the specified Object. 
-     * This is done in prepartion for invoking {@link setProperty()} 
-     * one or more times.
-     * @param object &$obj the object for which to set properties
-     */
-    function LoggerPropertySetter(&$obj)
-    {
-        $this->obj =& $obj;
-    }
-  
-    /**
-     * Set the properties of an object passed as a parameter in one
-     * go. The <code>properties</code> are parsed relative to a
-     * <code>prefix</code>.
-     *
-     * @param object &$obj The object to configure.
-     * @param array $properties An array containing keys and values.
-     * @param string $prefix Only keys having the specified prefix will be set.
-     * @static
-     */
-    function setPropertiesByObject(&$obj, $properties, $prefix)
-    {
-        $pSetter = new LoggerPropertySetter($obj);
-        return $pSetter->setProperties($properties, $prefix);
-    }
-  
-
-    /**
-     * Set the properites for the object that match the
-     * <code>prefix</code> passed as parameter.
-     *
-     * @param array $properties An array containing keys and values.
-     * @param string $prefix Only keys having the specified prefix will be set.
-     */
-    function setProperties($properties, $prefix)
-    {
-        LoggerLog::debug("LoggerOptionConverter::setProperties():prefix=[{$prefix}]");
-
-        $len = strlen($prefix);
-        while (list($key,) = each($properties)) {
-            if (strpos($key, $prefix) === 0) {
-                if (strpos($key, '.', ($len + 1)) > 0)
-                    continue;
-                $value = LoggerOptionConverter::findAndSubst($key, $properties);
-                $key = substr($key, $len);
-                if ($key == 'layout' and is_a($this->obj, 'loggerappender')) {
-                    continue;
-                }
-                $this->setProperty($key, $value);
-            }
-        }
-        $this->activate();
-    }
-    
-    /**
-     * Set a property on this PropertySetter's Object. If successful, this
-     * method will invoke a setter method on the underlying Object. The
-     * setter is the one for the specified property name and the value is
-     * determined partly from the setter argument type and partly from the
-     * value specified in the call to this method.
-     *
-     * <p>If the setter expects a String no conversion is necessary.
-     * If it expects an int, then an attempt is made to convert 'value'
-     * to an int using new Integer(value). If the setter expects a boolean,
-     * the conversion is by new Boolean(value).
-     *
-     * @param string $name    name of the property
-     * @param string $value   String value of the property
-     */
-    function setProperty($name, $value)
-    {
-        LoggerLog::debug("LoggerOptionConverter::setProperty():name=[{$name}]:value=[{$value}]");
-
-        if ($value === null) return;
-        
-        $method = "set" . ucfirst($name);
-        
-        if (!method_exists($this->obj, $method)) {
-            LoggerLog::warn(
-                "LoggerOptionConverter::setProperty() No such setter method for [{$name}] property in " .
-		        get_class($this->obj) . "." 
-            );
-        } else {
-            return call_user_func(array(&$this->obj, $method), $value);
-        } 
-    }
-  
-    function activate()
-    {
-        LoggerLog::debug("LoggerOptionConverter::activate()");
-    
-        if (method_exists($this->obj, 'activateoptions')) {
-            return call_user_func(array(&$this->obj, 'activateoptions'));
-        } else {
-            LoggerLog::debug("LoggerOptionConverter::activate() Nothing to activate.");
-        }
-    }
-}
-?>
\ No newline at end of file
diff --git a/libraries/log4php.debug/configurators/LoggerConfiguratorIni.php b/libraries/log4php.debug/configurators/LoggerConfiguratorIni.php
index df18511190f57f4195fcf20186179b88cc71e9f9..7d009b89c269b63666a19038ba1ae49236f2c8d6 100644
--- a/libraries/log4php.debug/configurators/LoggerConfiguratorIni.php
+++ b/libraries/log4php.debug/configurators/LoggerConfiguratorIni.php
@@ -57,7 +57,7 @@
  *
  * {@example ../../examples/resources/appender_dailyfile.properties 18}
  *
- * @version $Revision: 883104 $
+ * @version $Revision: 1071033 $
  * @package log4php
  * @subpackage configurators
  * @since 0.5
@@ -283,10 +283,14 @@ class LoggerConfiguratorIni implements LoggerConfigurator {
 	 */
 	public function configure(LoggerHierarchy $hierarchy, $url = '') {
 		$properties = @parse_ini_file($url);
-		if ($properties === false || count($properties) == 0) {
+		if ($properties === false) {
 			$error = error_get_last();
-		    throw new LoggerException("LoggerConfiguratorIni: ".$error['message']);
+			throw new LoggerException("LoggerConfiguratorIni: Error parsing configuration file: ".$error['message']);
 		}
+		if  (count($properties) == 0) {
+			trigger_error("LoggerConfiguratorIni: Configuration file is empty.", E_USER_WARNING);
+		}
+		
 		return $this->doConfigureProperties($properties, $hierarchy);
 	}
 
@@ -362,12 +366,8 @@ class LoggerConfiguratorIni implements LoggerConfigurator {
 	 */
 	private function parseAdditivityForLogger($props, Logger $cat, $loggerName) {
 		$value = LoggerOptionConverter::findAndSubst(self::ADDITIVITY_PREFIX . $loggerName, $props);
-		
-		// touch additivity only if necessary
-		if(!empty($value)) {
-			$additivity = LoggerOptionConverter::toBoolean($value, true);
-			$cat->setAdditivity($additivity);
-		}
+		$additivity = LoggerOptionConverter::toBoolean($value, true);
+		$cat->setAdditivity($additivity);
 	}
 
 	/**
@@ -453,11 +453,11 @@ class LoggerConfiguratorIni implements LoggerConfigurator {
 				}
 			}
 			
-			LoggerReflectionUtils::setPropertiesByObject($layout, $props, $layoutPrefix . ".");				  
+			LoggerReflectionUtils::setPropertiesByObject($layout, $props, $layoutPrefix . ".");
 			$appender->setLayout($layout);
 			
 		}
 		LoggerReflectionUtils::setPropertiesByObject($appender, $props, $prefix . ".");
-		return $appender;		 
+		return $appender;
 	}
 }
diff --git a/libraries/log4php.debug/configurators/LoggerConfiguratorPhp.php b/libraries/log4php.debug/configurators/LoggerConfiguratorPhp.php
index 8b4285a90439865daae105d2def78b4e801e2bfc..d25fa579ce6f0ef53ae60a843f61a1bf54c8fb8c 100644
--- a/libraries/log4php.debug/configurators/LoggerConfiguratorPhp.php
+++ b/libraries/log4php.debug/configurators/LoggerConfiguratorPhp.php
@@ -21,8 +21,9 @@
 /**
  * LoggerConfiguratorPhp class
  *
- * This class allows configuration of log4php through an external file that 
- * deliver a PHP array in return.
+ * This class allows configuration of log4php through a PHP array or an external file that
+ * returns a PHP array. If you use the PHP array option, you can simply give an array instead
+ * of an URL parameter.
  *
  * An example for this configurator is:
  *
@@ -43,13 +44,23 @@ class LoggerConfiguratorPhp implements LoggerConfigurator {
 	}
 	
 	private function doConfigure($url, LoggerHierarchy $hierarchy) {
-		
-		$config = require $url;
+		if (!is_array($url)) {
+ 			$config = require $url;
+ 		} else {
+ 			$config = $url;
+ 		}
 		
 		// set threshold
 		if(isset($config['threshold'])) {
 			$hierarchy->setThreshold(LoggerOptionConverter::toLevel($config['threshold'], LoggerLevel::getLevelAll()));
 		}
+
+		// add renderes
+		if (isset($config['renderers'])) {
+			foreach ($config['renderers'] as $renderedClass => $renderingClass) {
+				$hierarchy->getRendererMap()->addRenderer($renderedClass, $renderingClass);
+			}
+		}
 		
 		// parse and create appenders
 		if(isset($config['appenders'])) {
@@ -58,12 +69,15 @@ class LoggerConfiguratorPhp implements LoggerConfigurator {
 				
 				$appender = LoggerAppenderPool::getAppenderFromPool($appenderName, $appenderProperties['class']);
 				
+				// unset so that the property wont be drawn up again
+				unset($appenderProperties['class']);
+				
 				if($appender->requiresLayout()) {
 					
 					if(isset($appenderProperties['layout'])) {
 						
 						if(isset($appenderProperties['layout']['class']) and !empty($appenderProperties['layout']['class'])) {
-							$layoutClass = $appenderProperties['layout']['class'];							
+							$layoutClass = $appenderProperties['layout']['class'];
 						} else {
 							$layoutClass = 'LoggerLayoutSimple';
 						}
@@ -73,18 +87,29 @@ class LoggerConfiguratorPhp implements LoggerConfigurator {
 							$layout = LoggerReflectionUtils::createObject('LoggerLayoutSimple');
 						}
 						
+						if(isset($appenderProperties['file']) && method_exists($appender, 'setFileName')) { 
+ 						    $appender->setFile($appenderProperties['file'], true); 
+						}
+						
 						if($layout instanceof LoggerLayoutPattern) {
 							$layout->setConversionPattern($appenderProperties['layout']['conversionPattern']);
 						}
 						
 						$appender->setLayout($layout);
 						
+						// unset so that the property wont be drawn up again
+						unset($appenderProperties['layout']);
 					} else {
 						// TODO: throw exception?
 					}
 					
 				}
-				
+				// set remaining properties and activate appender
+				$setter = new LoggerReflectionUtils($appender);
+				foreach ($appenderProperties as $key => $val) {
+					$setter->setProperty($key, $val);
+ 				}
+				$setter->activate();
 			}
 			
 		}
diff --git a/libraries/log4php.debug/configurators/LoggerConfiguratorXml.php b/libraries/log4php.debug/configurators/LoggerConfiguratorXml.php
index bef41f669608c9c4d876fbb84c077e1a8b87aadc..58947f78b1ca9508848f777eb5361f05505ff707 100644
--- a/libraries/log4php.debug/configurators/LoggerConfiguratorXml.php
+++ b/libraries/log4php.debug/configurators/LoggerConfiguratorXml.php
@@ -38,7 +38,7 @@
  * 
  * <p>There are more sample XML files included in the package under tests/ subdirectories.</p>
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1059292 $
  * @package log4php
  * @subpackage configurators
  * @since 0.4 
@@ -58,13 +58,13 @@ class LoggerConfiguratorXml implements LoggerConfigurator {
 	const DEFAULT_CONFIGURATION = 
 	'<?xml version="1.0" ?>
 	<log4php:configuration threshold="all">
-	    <appender name="A1" class="LoggerAppenderEcho">
-	        <layout class="LoggerLayoutSimple" />
-	    </appender>
-	    <root>
-	        <level value="debug" />
-	        <appender_ref ref="A1" />
-	    </root>
+		<appender name="A1" class="LoggerAppenderEcho">
+			<layout class="LoggerLayoutSimple" />
+		</appender>
+		<root>
+			<level value="debug" />
+			<appender_ref ref="A1" />
+		</root>
 	</log4php:configuration>';
 	
 	/**
@@ -72,370 +72,370 @@ class LoggerConfiguratorXml implements LoggerConfigurator {
 	 */
 	const XMLNS = 'HTTP://LOGGING.APACHE.ORG/LOG4PHP/'; 
 
-    /**
-     * @var LoggerHierarchy
-     */
-    private $repository;
-    
-    /**
-     * @var array state stack 
-     */
-    private $state;
-
-    /**
-     * @var Logger parsed Logger  
-     */
-    private $logger;
-    
-    /**
-     * @var LoggerAppender parsed LoggerAppender 
-     */
-    private $appender;
-    
-    /**
-     * @var LoggerFilter parsed LoggerFilter 
-     */
-    private $filter;
-    
-    /**
-     * @var LoggerLayout parsed LoggerLayout 
-     */
-    private $layout;
-    
-    /**
-     * Constructor
-     */
-    public function __construct() {
-        $this->state    = array();
-        $this->logger   = null;
-        $this->appender = null;
-        $this->filter   = null;
-        $this->layout   = null;
-    }
-    
-    /**
-     * Configure the default repository using the resource pointed by <b>url</b>.
-     * <b>Url</b> is any valid resource as defined in {@link PHP_MANUAL#file} function.
-     * Note that the resource will be search with <i>use_include_path</i> parameter 
-     * set to "1".
-     *
-     * @param string $url
-     * @static
-     */
-    public function configure(LoggerHierarchy $hierarchy, $url = '') {
-        return $this->doConfigure($url, $hierarchy);
-    }
-    
-    /**
-     * Configure the given <b>repository</b> using the resource pointed by <b>url</b>.
-     * <b>Url</b> is any valid resurce as defined in {@link PHP_MANUAL#file} function.
-     * Note that the resource will be search with <i>use_include_path</i> parameter 
-     * set to "1".
-     *
-     * @param string $url
-     * @param LoggerHierarchy $repository
-     */
-    private function doConfigure($url = '', LoggerHierarchy $repository)
-    {
-        $xmlData = '';
-        if (!empty($url))
-            $xmlData = implode('', file($url, 1));
-        return $this->doConfigureByString($xmlData, $repository);
-    }
-    
-    /**
-     * Configure the given <b>repository</b> using the configuration written in <b>xmlData</b>.
-     * Do not call this method directly. Use {@link doConfigure()} instead.
-     * @param string $xmlData
-     * @param LoggerHierarchy $repository
-     */
-    private function doConfigureByString($xmlData, LoggerHierarchy $repository)
-    {
-        return $this->parse($xmlData, $repository);
-    }
-    
-    /**
-     * @param LoggerHierarchy $repository
-     */
-    private function doConfigureDefault(LoggerHierarchy $repository)
-    {
-        return $this->doConfigureByString(self::DEFAULT_CONFIGURATION, $repository);
-    }
-    
-    /**
-     * @param string $xmlData
-     */
-    private function parse($xmlData, LoggerHierarchy $repository)
-    {
-        // Logger::resetConfiguration();
-        $this->repository = $repository;
+	/**
+	 * @var LoggerHierarchy
+	 */
+	private $repository;
+	
+	/**
+	 * @var array state stack 
+	 */
+	private $state;
 
-        $parser = xml_parser_create_ns();
-    
-        xml_set_object($parser, $this);
-        xml_set_element_handler($parser, "tagOpen", "tagClose");
-        
-        $result = xml_parse($parser, $xmlData, true);
-        if (!$result) {
-            $errorCode = xml_get_error_code($parser);
-            $errorStr = xml_error_string($errorCode);
-            $errorLine = xml_get_current_line_number($parser);
-            $this->repository->resetConfiguration();
-        } else {
-            xml_parser_free($parser);
-        }
-        return $result;
-    }
-    
-    /**
-     * @param mixed $parser
-     * @param string $tag
-     * @param array $attribs
-     *
-     * @todo In 'LOGGER' case find a better way to detect 'getLogger()' method
-     */
-    private function tagOpen($parser, $tag, $attribs)
-    {
-        switch ($tag) {
-        
-            case 'CONFIGURATION' :
-            case self::XMLNS.':CONFIGURATION':
-            
-                if (isset($attribs['THRESHOLD'])) {
-                
-                    $this->repository->setThreshold(
-                        LoggerOptionConverter::toLevel(
-                            $this->subst($attribs['THRESHOLD']), 
-                            $this->repository->getThreshold()
-                        )
-                    );
-                }
-                break;
-                
-            case 'APPENDER' :
-            case self::XMLNS.':APPENDER':
-            
-                unset($this->appender);
-                $this->appender = null;
-                
-                $name  = $this->subst(@$attribs['NAME']);
-                $class = $this->subst(@$attribs['CLASS']);
-                
-                $this->appender = LoggerAppenderPool::getAppenderFromPool($name, $class);
-                
-                if (isset($attribs['THRESHOLD'])) {
-                    $this->appender->setThreshold(
-                        LoggerOptionConverter::toLevel(
-                            $this->subst($attribs['THRESHOLD']), $this->appender->getThreshold()));
-                }
-                
-                $this->state[] = self::APPENDER_STATE;
-                break;
-                
-            case 'APPENDER_REF' :
-            case 'APPENDER-REF' :
-            case self::XMLNS.':APPENDER_REF':
-            case self::XMLNS.':APPENDER-REF':
-                if (isset($attribs['REF']) and !empty($attribs['REF'])) {
-                    $appenderName = $this->subst($attribs['REF']);
-                    
-                    $appender = LoggerAppenderPool::getAppenderFromPool($appenderName);
-                    if ($appender !== null) {
-                        switch (end($this->state)) {
-                            case self::LOGGER_STATE:
-                            case self::ROOT_STATE:                
-                                $this->logger->addAppender($appender);
-                                break;
-                        }
-                    }
-                } 
-                break;
-                
-            case 'FILTER' :
-            case self::XMLNS.':FILTER':
-                unset($this->filter);
-                $this->filter = null;
+	/**
+	 * @var Logger parsed Logger  
+	 */
+	private $logger;
+	
+	/**
+	 * @var LoggerAppender parsed LoggerAppender 
+	 */
+	private $appender;
+	
+	/**
+	 * @var LoggerFilter parsed LoggerFilter 
+	 */
+	private $filter;
+	
+	/**
+	 * @var LoggerLayout parsed LoggerLayout 
+	 */
+	private $layout;
+	
+	/**
+	 * Constructor
+	 */
+	public function __construct() {
+		$this->state	= array();
+		$this->logger   = null;
+		$this->appender = null;
+		$this->filter   = null;
+		$this->layout   = null;
+	}
+	
+	/**
+	 * Configure the default repository using the resource pointed by <b>url</b>.
+	 * <b>Url</b> is any valid resource as defined in {@link PHP_MANUAL#file} function.
+	 * Note that the resource will be search with <i>use_include_path</i> parameter 
+	 * set to "1".
+	 *
+	 * @param string $url
+	 * @static
+	 */
+	public function configure(LoggerHierarchy $hierarchy, $url = '') {
+		return $this->doConfigure($url, $hierarchy);
+	}
+	
+	/**
+	 * Configure the given <b>repository</b> using the resource pointed by <b>url</b>.
+	 * <b>Url</b> is any valid resurce as defined in {@link PHP_MANUAL#file} function.
+	 * Note that the resource will be search with <i>use_include_path</i> parameter 
+	 * set to "1".
+	 *
+	 * @param string $url
+	 * @param LoggerHierarchy $repository
+	 */
+	private function doConfigure($url = '', LoggerHierarchy $repository)
+	{
+		$xmlData = '';
+		if (!empty($url))
+			$xmlData = implode('', file($url, 1));
+		return $this->doConfigureByString($xmlData, $repository);
+	}
+	
+	/**
+	 * Configure the given <b>repository</b> using the configuration written in <b>xmlData</b>.
+	 * Do not call this method directly. Use {@link doConfigure()} instead.
+	 * @param string $xmlData
+	 * @param LoggerHierarchy $repository
+	 */
+	private function doConfigureByString($xmlData, LoggerHierarchy $repository)
+	{
+		return $this->parse($xmlData, $repository);
+	}
+	
+	/**
+	 * @param LoggerHierarchy $repository
+	 */
+	private function doConfigureDefault(LoggerHierarchy $repository)
+	{
+		return $this->doConfigureByString(self::DEFAULT_CONFIGURATION, $repository);
+	}
+	
+	/**
+	 * @param string $xmlData
+	 */
+	private function parse($xmlData, LoggerHierarchy $repository)
+	{
+		// Logger::resetConfiguration();
+		$this->repository = $repository;
 
-                $filterName = basename($this->subst(@$attribs['CLASS']));
-                if (!empty($filterName)) {
-                    $this->filter = new $filterName();
-                    $this->state[] = self::FILTER_STATE;
-                } 
-                break;
-                
-            case 'LAYOUT':
-            case self::XMLNS.':LAYOUT':
-                $class = @$attribs['CLASS'];
-                $this->layout = LoggerReflectionUtils::createObject($this->subst($class));
-                $this->state[] = self::LAYOUT_STATE;
-                break;
-            
-            case 'LOGGER':
-            case self::XMLNS.':LOGGER':
-                // $this->logger is assigned by reference.
-                // Only '$this->logger=null;' destroys referenced object
-                unset($this->logger);
-                $this->logger = null;
-                
-                $loggerName = $this->subst(@$attribs['NAME']);
-                if (!empty($loggerName)) {
-                    $this->logger = $this->repository->getLogger($loggerName);
-                    if ($this->logger !== null and isset($attribs['ADDITIVITY'])) {
-                        $additivity = LoggerOptionConverter::toBoolean($this->subst($attribs['ADDITIVITY']), true);     
-                        $this->logger->setAdditivity($additivity);
-                    }
-                } 
-                $this->state[] = self::LOGGER_STATE;;
-                break;
-            
-            case 'LEVEL':
-            case self::XMLNS.':LEVEL':
-            case 'PRIORITY':
-            case self::XMLNS.':PRIORITY':
-            
-                if (!isset($attribs['VALUE'])) {
-                    // LoggerDOMConfigurator::tagOpen() LEVEL value not set
-                    break;
-                }
-                    
-                if ($this->logger === null) { 
-                    // LoggerDOMConfigurator::tagOpen() LEVEL. parent logger is null
-                    break;
-                }
-        
-                switch (end($this->state)) {
-                    case self::ROOT_STATE:
-                        $this->logger->setLevel(
-                            LoggerOptionConverter::toLevel(
-                                $this->subst($attribs['VALUE']), 
-                                $this->logger->getLevel()
-                            )
-                        );
-                        break;
-                    case self::LOGGER_STATE:
-                        $this->logger->setLevel(
-                            LoggerOptionConverter::toLevel(
-                                $this->subst($attribs['VALUE']), 
-                                $this->logger->getLevel()
-                            )
-                        );
-                        break;
-                    default:
-                        //LoggerLog::warn("LoggerDOMConfigurator::tagOpen() LEVEL state '{$this->state}' not allowed here");
-                }
-                break;
-            
-            case 'PARAM':
-            case self::XMLNS.':PARAM':
-                if (!isset($attribs['NAME'])) {
-                    // LoggerDOMConfigurator::tagOpen() PARAM attribute 'name' not defined.
-                    break;
-                }
-                if (!isset($attribs['VALUE'])) {
-                    // LoggerDOMConfigurator::tagOpen() PARAM. attribute 'value' not defined.
-                    break;
-                }
-                    
-                switch (end($this->state)) {
-                    case self::APPENDER_STATE:
-                        if ($this->appender !== null) {
-                            LoggerReflectionUtils::setter($this->appender, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));
-                        }
-                        break;
-                    case self::LAYOUT_STATE:
-                        if ($this->layout !== null) {
-                            LoggerReflectionUtils::setter($this->layout, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));                
-                        }
-                        break;
-                    case self::FILTER_STATE:
-                        if ($this->filter !== null) {
-                            LoggerReflectionUtils::setter($this->filter, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));
-                        }
-                        break;
-                    default:
-                        //LoggerLog::warn("LoggerDOMConfigurator::tagOpen() PARAM state '{$this->state}' not allowed here");
-                }
-                break;
-            
-            case 'RENDERER':
-            case self::XMLNS.':RENDERER':
+		$parser = xml_parser_create_ns();
+	
+		xml_set_object($parser, $this);
+		xml_set_element_handler($parser, "tagOpen", "tagClose");
+		
+		$result = xml_parse($parser, $xmlData, true);
+		if (!$result) {
+			$errorCode = xml_get_error_code($parser);
+			$errorStr = xml_error_string($errorCode);
+			$errorLine = xml_get_current_line_number($parser);
+			$this->repository->resetConfiguration();
+		} else {
+			xml_parser_free($parser);
+		}
+		return $result;
+	}
+	
+	/**
+	 * @param mixed $parser
+	 * @param string $tag
+	 * @param array $attribs
+	 *
+	 * @todo In 'LOGGER' case find a better way to detect 'getLogger()' method
+	 */
+	private function tagOpen($parser, $tag, $attribs)
+	{
+		switch ($tag) {
+		
+			case 'CONFIGURATION' :
+			case self::XMLNS.':CONFIGURATION':
+			
+				if (isset($attribs['THRESHOLD'])) {
+				
+					$this->repository->setThreshold(
+						LoggerOptionConverter::toLevel(
+							$this->subst($attribs['THRESHOLD']), 
+							$this->repository->getThreshold()
+						)
+					);
+				}
+				break;
+				
+			case 'APPENDER' :
+			case self::XMLNS.':APPENDER':
+			
+				unset($this->appender);
+				$this->appender = null;
+				
+				$name  = $this->subst(@$attribs['NAME']);
+				$class = $this->subst(@$attribs['CLASS']);
+				
+				$this->appender = LoggerAppenderPool::getAppenderFromPool($name, $class);
+				
+				if (isset($attribs['THRESHOLD'])) {
+					$this->appender->setThreshold(
+						LoggerOptionConverter::toLevel(
+							$this->subst($attribs['THRESHOLD']), $this->appender->getThreshold()));
+				}
+				
+				$this->state[] = self::APPENDER_STATE;
+				break;
+				
+			case 'APPENDER_REF' :
+			case 'APPENDER-REF' :
+			case self::XMLNS.':APPENDER_REF':
+			case self::XMLNS.':APPENDER-REF':
+				if (isset($attribs['REF']) and !empty($attribs['REF'])) {
+					$appenderName = $this->subst($attribs['REF']);
+					
+					$appender = LoggerAppenderPool::getAppenderFromPool($appenderName);
+					if ($appender !== null) {
+						switch (end($this->state)) {
+							case self::LOGGER_STATE:
+							case self::ROOT_STATE:
+								$this->logger->addAppender($appender);
+								break;
+						}
+					}
+				} 
+				break;
+				
+			case 'FILTER' :
+			case self::XMLNS.':FILTER':
+				unset($this->filter);
+				$this->filter = null;
+				
+				$filterName = basename($this->subst(@$attribs['CLASS']));
+				if (!empty($filterName)) {
+					$this->filter = new $filterName();
+					$this->state[] = self::FILTER_STATE;
+				} 
+				break;
+				
+			case 'LAYOUT':
+			case self::XMLNS.':LAYOUT':
+				$class = @$attribs['CLASS'];
+				$this->layout = LoggerReflectionUtils::createObject($this->subst($class));
+				$this->state[] = self::LAYOUT_STATE;
+				break;
+			
+			case 'LOGGER':
+			case self::XMLNS.':LOGGER':
+				// $this->logger is assigned by reference.
+				// Only '$this->logger=null;' destroys referenced object
+				unset($this->logger);
+				$this->logger = null;
+				
+				$loggerName = $this->subst(@$attribs['NAME']);
+				if (!empty($loggerName)) {
+					$this->logger = $this->repository->getLogger($loggerName);
+					if ($this->logger !== null and isset($attribs['ADDITIVITY'])) {
+						$additivity = LoggerOptionConverter::toBoolean($this->subst($attribs['ADDITIVITY']), true);	 
+						$this->logger->setAdditivity($additivity);
+					}
+				} 
+				$this->state[] = self::LOGGER_STATE;;
+				break;
+			
+			case 'LEVEL':
+			case self::XMLNS.':LEVEL':
+			case 'PRIORITY':
+			case self::XMLNS.':PRIORITY':
+			
+				if (!isset($attribs['VALUE'])) {
+					// LoggerDOMConfigurator::tagOpen() LEVEL value not set
+					break;
+				}
+					
+				if ($this->logger === null) { 
+					// LoggerDOMConfigurator::tagOpen() LEVEL. parent logger is null
+					break;
+				}
+				
+				switch (end($this->state)) {
+					case self::ROOT_STATE:
+						$this->logger->setLevel(
+							LoggerOptionConverter::toLevel(
+								$this->subst($attribs['VALUE']), 
+								$this->logger->getLevel()
+							)
+						);
+						break;
+					case self::LOGGER_STATE:
+						$this->logger->setLevel(
+							LoggerOptionConverter::toLevel(
+								$this->subst($attribs['VALUE']), 
+								$this->logger->getLevel()
+							)
+						);
+						break;
+					default:
+						//LoggerLog::warn("LoggerDOMConfigurator::tagOpen() LEVEL state '{$this->state}' not allowed here");
+				}
+				break;
+			
+			case 'PARAM':
+			case self::XMLNS.':PARAM':
+				if (!isset($attribs['NAME'])) {
+					// LoggerDOMConfigurator::tagOpen() PARAM attribute 'name' not defined.
+					break;
+				}
+				if (!isset($attribs['VALUE'])) {
+					// LoggerDOMConfigurator::tagOpen() PARAM. attribute 'value' not defined.
+					break;
+				}
+					
+				switch (end($this->state)) {
+					case self::APPENDER_STATE:
+						if ($this->appender !== null) {
+							LoggerReflectionUtils::setter($this->appender, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));
+						}
+						break;
+					case self::LAYOUT_STATE:
+						if ($this->layout !== null) {
+							LoggerReflectionUtils::setter($this->layout, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));
+						}
+						break;
+					case self::FILTER_STATE:
+						if ($this->filter !== null) {
+							LoggerReflectionUtils::setter($this->filter, $this->subst($attribs['NAME']), $this->subst($attribs['VALUE']));
+						}
+						break;
+					default:
+						//LoggerLog::warn("LoggerDOMConfigurator::tagOpen() PARAM state '{$this->state}' not allowed here");
+				}
+				break;
+			
+			case 'RENDERER':
+			case self::XMLNS.':RENDERER':
 
-                $renderedClass   = $this->subst(@$attribs['RENDEREDCLASS']);
-                $renderingClass  = $this->subst(@$attribs['RENDERINGCLASS']);
-        
-                if (!empty($renderedClass) and !empty($renderingClass)) {
-                    $this->repository->getRendererMap()->addRenderer($renderedClass, $renderingClass);
-                }
-                break;
-            
-            case 'ROOT':
-            case self::XMLNS.':ROOT':
-                $this->logger = Logger::getRootLogger();
-                $this->state[] = self::ROOT_STATE;
-                break;
-        }
-    }
+				$renderedClass   = $this->subst(@$attribs['RENDEREDCLASS']);
+				$renderingClass  = $this->subst(@$attribs['RENDERINGCLASS']);
+		
+				if (!empty($renderedClass) and !empty($renderingClass)) {
+					$this->repository->getRendererMap()->addRenderer($renderedClass, $renderingClass);
+				}
+				break;
+			
+			case 'ROOT':
+			case self::XMLNS.':ROOT':
+				$this->logger = Logger::getRootLogger();
+				$this->state[] = self::ROOT_STATE;
+				break;
+		}
+	}
 
 
-    /**
-     * @param mixed $parser
-     * @param string $tag
-     */
-    private function tagClose($parser, $tag)
-    {
-        switch ($tag) {
-        
-            case 'CONFIGURATION' : 
-            case self::XMLNS.':CONFIGURATION':
-                break;
-                
-            case 'APPENDER' :
-            case self::XMLNS.':APPENDER':
-                if ($this->appender !== null) {
-                    if ($this->appender->requiresLayout() and $this->appender->getLayout() === null) {
-                        $appenderName = $this->appender->getName();
-                        $this->appender->setLayout(LoggerReflectionUtils::createObject('LoggerLayoutSimple'));
-                    }                    
-                    $this->appender->activateOptions();
-                }        
-                array_pop($this->state);        
-                break;
-                
-            case 'FILTER' :
-            case self::XMLNS.':FILTER':
-                if ($this->filter !== null) {
-                    $this->filter->activateOptions();
-                    $this->appender->addFilter($this->filter);
-                    $this->filter = null;
-                }
-                array_pop($this->state);        
-                break;
-                
-            case 'LAYOUT':
-            case self::XMLNS.':LAYOUT':
-                if ($this->appender !== null and $this->layout !== null and $this->appender->requiresLayout()) {
-                    $this->layout->activateOptions();
-                    $this->appender->setLayout($this->layout);
-                    $this->layout = null;
-                }
-                array_pop($this->state);
-                break;
-            
-            case 'LOGGER':
-            case self::XMLNS.':LOGGER':
-                array_pop($this->state);
-                break;
-            
-            case 'ROOT':
-            case self::XMLNS.':ROOT':
-                array_pop($this->state);
-                break;
-        }
-    }
-    
-    private function subst($value)
-    {
-        return LoggerOptionConverter::substVars($value);
-    }
+	/**
+	 * @param mixed $parser
+	 * @param string $tag
+	 */
+	private function tagClose($parser, $tag)
+	{
+		switch ($tag) {
+		
+			case 'CONFIGURATION' : 
+			case self::XMLNS.':CONFIGURATION':
+				break;
+				
+			case 'APPENDER' :
+			case self::XMLNS.':APPENDER':
+				if ($this->appender !== null) {
+					if ($this->appender->requiresLayout() and $this->appender->getLayout() === null) {
+						$appenderName = $this->appender->getName();
+						$this->appender->setLayout(LoggerReflectionUtils::createObject('LoggerLayoutSimple'));
+					}					
+					$this->appender->activateOptions();
+				}		
+				array_pop($this->state);
+				break;
+				
+			case 'FILTER' :
+			case self::XMLNS.':FILTER':
+				if ($this->filter !== null) {
+					$this->filter->activateOptions();
+					$this->appender->addFilter($this->filter);
+					$this->filter = null;
+				}
+				array_pop($this->state);
+				break;
+				
+			case 'LAYOUT':
+			case self::XMLNS.':LAYOUT':
+				if ($this->appender !== null and $this->layout !== null and $this->appender->requiresLayout()) {
+					$this->layout->activateOptions();
+					$this->appender->setLayout($this->layout);
+					$this->layout = null;
+				}
+				array_pop($this->state);
+				break;
+			
+			case 'LOGGER':
+			case self::XMLNS.':LOGGER':
+				array_pop($this->state);
+				break;
+			
+			case 'ROOT':
+			case self::XMLNS.':ROOT':
+				array_pop($this->state);
+				break;
+		}
+	}
+	
+	private function subst($value)
+	{
+		return LoggerOptionConverter::substVars($value);
+	}
 
 }
diff --git a/libraries/log4php.debug/filters/LoggerFilterLevelMatch.php b/libraries/log4php.debug/filters/LoggerFilterLevelMatch.php
index 02b97dc3537aec63766cceee3be978d48ed9a115..02dbadc9dbad9f42b86b1479d8b15b85ff81b803 100644
--- a/libraries/log4php.debug/filters/LoggerFilterLevelMatch.php
+++ b/libraries/log4php.debug/filters/LoggerFilterLevelMatch.php
@@ -40,7 +40,7 @@
  * 
  * {@example ../../examples/resources/filter_levelmatch.xml 18}
  * 
- * @version $Revision: 883108 $
+ * @version $Revision: 1059292 $
  * @package log4php
  * @subpackage filters
  * @since 0.6
@@ -71,7 +71,7 @@ class LoggerFilterLevelMatch extends LoggerFilter {
 	 */
 	public function setLevelToMatch($l) {
 		if($l instanceof LoggerLevel) {
-		    $this->levelToMatch = $l;
+			$this->levelToMatch = $l;
 		} else {
 			$this->levelToMatch = LoggerOptionConverter::toLevel($l, null);
 		}
diff --git a/libraries/log4php.debug/filters/LoggerFilterLevelRange.php b/libraries/log4php.debug/filters/LoggerFilterLevelRange.php
index 49ecf8851d616566a56b9350605c6686b122919a..b9083a64207dd1409f66b9e19a37dc3d047dc020 100644
--- a/libraries/log4php.debug/filters/LoggerFilterLevelRange.php
+++ b/libraries/log4php.debug/filters/LoggerFilterLevelRange.php
@@ -57,7 +57,7 @@
  * @author Simon Kitching
  * @author based on the org.apache.log4j.varia.LevelRangeFilte Java code by Ceki G&uuml;lc&uuml; 
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1059292 $
  * @package log4php
  * @subpackage filters
  * @since 0.6
@@ -91,7 +91,7 @@ class LoggerFilterLevelRange extends LoggerFilter {
 	 */
 	public function setLevelMin($l) {
 		if($l instanceof LoggerLevel) {
-		    $this->levelMin = $l;
+			$this->levelMin = $l;
 		} else {
 			$this->levelMin = LoggerOptionConverter::toLevel($l, null);
 		}
@@ -102,7 +102,7 @@ class LoggerFilterLevelRange extends LoggerFilter {
 	 */
 	public function setLevelMax($l) {
 		if($l instanceof LoggerLevel) {
-		    $this->levelMax = $l;
+			$this->levelMax = $l;
 		} else {
 			$this->levelMax = LoggerOptionConverter::toLevel($l, null);
 		}
diff --git a/libraries/log4php.debug/helpers/LoggerBasicPatternConverter.php b/libraries/log4php.debug/helpers/LoggerBasicPatternConverter.php
index ee081a52c32b66673cceafcb1c4cb4ea5e874edd..18b8c9134652a221b4e421f599e5bfff914c3e1e 100644
--- a/libraries/log4php.debug/helpers/LoggerBasicPatternConverter.php
+++ b/libraries/log4php.debug/helpers/LoggerBasicPatternConverter.php
@@ -36,8 +36,8 @@ class LoggerBasicPatternConverter extends LoggerPatternConverter {
 	 * @param integer $type
 	 */
 	public function __construct($formattingInfo, $type) {
-	  parent::__construct($formattingInfo);
-	  $this->type = $type;
+		parent::__construct($formattingInfo);
+		$this->type = $type;
 	}
 
 	/**
diff --git a/libraries/log4php.debug/helpers/LoggerClassNamePatternConverter.php b/libraries/log4php.debug/helpers/LoggerClassNamePatternConverter.php
index a067c9d5aad5cbfa243edb390ab5d86bd018048d..88e2cd86c95b3909cce33a4a451cf1186d9db1a0 100644
--- a/libraries/log4php.debug/helpers/LoggerClassNamePatternConverter.php
+++ b/libraries/log4php.debug/helpers/LoggerClassNamePatternConverter.php
@@ -39,7 +39,7 @@ class LoggerClassNamePatternConverter extends LoggerNamedPatternConverter {
 	 * @return string
 	 */
 	public function getFullyQualifiedName($event) {
-		return $event->fqcn;
+		return $event->getFullQualifiedClassname();
 	}
 }
 
diff --git a/libraries/log4php.debug/helpers/LoggerDatePatternConverter.php b/libraries/log4php.debug/helpers/LoggerDatePatternConverter.php
index ee5ddcf8cc83b74526e5aac5751573213e51de7c..fcbc440c2e82c6a56722d571c1b2cf7756658a83 100644
--- a/libraries/log4php.debug/helpers/LoggerDatePatternConverter.php
+++ b/libraries/log4php.debug/helpers/LoggerDatePatternConverter.php
@@ -47,7 +47,7 @@ class LoggerDatePatternConverter extends LoggerPatternConverter {
 	public function convert($event) {
 		$timeStamp = $event->getTimeStamp();
 		$usecs = round(($timeStamp - (int)$timeStamp) * 1000);
-		$this->df = preg_replace('/((?<!\\\\)(?:\\\\{2})*)u/', '${1}' . sprintf('%03d', $usecs), $this->df);
-		return date($this->df, $event->getTimeStamp());
+		$df = preg_replace('/((?<!\\\\)(?:\\\\{2})*)u/', '${1}' . sprintf('%03d', $usecs), $this->df);
+		return date($df, $timeStamp);
 	}
 }
diff --git a/libraries/log4php.debug/helpers/LoggerFormattingInfo.php b/libraries/log4php.debug/helpers/LoggerFormattingInfo.php
index a3217c1abd9f6db2fceae37b45931564618ba139..9ebcc7e63aa50528ba264a3cfa45cedc6138389b 100644
--- a/libraries/log4php.debug/helpers/LoggerFormattingInfo.php
+++ b/libraries/log4php.debug/helpers/LoggerFormattingInfo.php
@@ -16,15 +16,6 @@
  * limitations under the License.
  *
  * @package log4php
- * @subpackage helpers
- */
-
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
- 
-/**
  */
 
 /**
@@ -49,7 +40,7 @@ class LoggerFormattingInfo {
 	public function reset() {
 		$this->min = -1;
 		$this->max = 0x7FFFFFFF;
-		$this->leftAlign = false;	  
+		$this->leftAlign = false;
 	}
 
 	public function dump() {
diff --git a/libraries/log4php.debug/helpers/LoggerLocationPatternConverter.php b/libraries/log4php.debug/helpers/LoggerLocationPatternConverter.php
index f3f0d2e8db0d4a685448f81227fa6fbc7fec5a1b..5d78c923c3e0edd9ed999840ccbab10c982d9707 100644
--- a/libraries/log4php.debug/helpers/LoggerLocationPatternConverter.php
+++ b/libraries/log4php.debug/helpers/LoggerLocationPatternConverter.php
@@ -36,8 +36,8 @@ class LoggerLocationPatternConverter extends LoggerPatternConverter {
 	 * @param integer $type
 	 */
 	public function __construct($formattingInfo, $type) {
-	  parent::__construct($formattingInfo);
-	  $this->type = $type;
+		parent::__construct($formattingInfo);
+		$this->type = $type;
 	}
 
 	/**
@@ -55,6 +55,8 @@ class LoggerLocationPatternConverter extends LoggerPatternConverter {
 				return $locationInfo->getLineNumber();
 			case LoggerPatternParser::FILE_LOCATION_CONVERTER:
 				return $locationInfo->getFileName();
+			case LoggerPatternParser::CLASS_LOCATION_CONVERTER:
+				return $locationInfo->getFullQualifiedClassname();
 			default: 
 				return '';
 		}
diff --git a/libraries/log4php.debug/helpers/LoggerNamedPatternConverter.php b/libraries/log4php.debug/helpers/LoggerNamedPatternConverter.php
index 19051ab1523676634111ec3d75daa941254e450e..087ec0a63fc3b8e54e28f165ceec30114f72dc0d 100644
--- a/libraries/log4php.debug/helpers/LoggerNamedPatternConverter.php
+++ b/libraries/log4php.debug/helpers/LoggerNamedPatternConverter.php
@@ -37,8 +37,8 @@ class LoggerNamedPatternConverter extends LoggerPatternConverter {
 	 * @param integer $precision
 	 */
 	public function __construct($formattingInfo, $precision) {
-	  parent::__construct($formattingInfo);
-	  $this->precision =  $precision;
+		parent::__construct($formattingInfo);
+		$this->precision = $precision;
 	}
 
 	/**
diff --git a/libraries/log4php.debug/helpers/LoggerOptionConverter.php b/libraries/log4php.debug/helpers/LoggerOptionConverter.php
index 9c387eb7650a7ba1ac938e2dd8b6ec058ecd4d62..dec46746ca585202cbb267c569d88acb0841fa85 100644
--- a/libraries/log4php.debug/helpers/LoggerOptionConverter.php
+++ b/libraries/log4php.debug/helpers/LoggerOptionConverter.php
@@ -18,17 +18,10 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-require_once(LOG4PHP_DIR . '/LoggerLevel.php');
-
 /**
  * A convenience class to convert property values to specific types.
  *
- * @version $Revision: 822464 $ 
+ * @version $Revision: 1059292 $ 
  * @package log4php
  * @subpackage helpers
  * @static
@@ -41,21 +34,21 @@ class LoggerOptionConverter {
 	const DELIM_START_LEN = 2;
 	const DELIM_STOP_LEN = 1;
 
-   /**
-	* Read a predefined var.
-	*
-	* It returns a value referenced by <var>$key</var> using this search criteria:
-	* - if <var>$key</var> is a constant then return it. Else
-	* - if <var>$key</var> is set in <var>$_ENV</var> then return it. Else
-	* - return <var>$def</var>. 
-	*
-	* @param string $key The key to search for.
-	* @param string $def The default value to return.
-	* @return string	the string value of the system property, or the default
-	*					value if there is no property with that key.
-	*
-	* @static
-	*/
+	/**
+	 * Read a predefined var.
+	 *
+	 * It returns a value referenced by <var>$key</var> using this search criteria:
+	 * - if <var>$key</var> is a constant then return it. Else
+	 * - if <var>$key</var> is set in <var>$_ENV</var> then return it. Else
+	 * - return <var>$def</var>. 
+	 *
+	 * @param string $key The key to search for.
+	 * @param string $def The default value to return.
+	 * @return string	the string value of the system property, or the default
+	 *					value if there is no property with that key.
+	 *
+	 * @static
+	 */
 	public static function getSystemProperty($key, $def) {
 		if(defined($key)) {
 			return (string)constant($key);
@@ -83,20 +76,19 @@ class LoggerOptionConverter {
 	 * @static
 	 */
 	public static function toBoolean($value, $default=true) {
-	    if (is_null($value)) {
+		if (is_null($value)) {
 			return $default;
-	    } elseif (is_string($value)) {
-		$trimmedVal = strtolower(trim($value));
-	
-            if("1" == $trimmedVal or "true" == $trimmedVal or "yes" == $trimmedVal or "on" == $trimmedVal) {
-			return true;
-            } else if ("" == $trimmedVal or "0" == $trimmedVal or "false" == $trimmedVal or "no" == $trimmedVal or "off" == $trimmedVal) {
-			return false;
-		}
+		} elseif (is_string($value)) {
+			$trimmedVal = strtolower(trim($value));
+			if("1" == $trimmedVal or "true" == $trimmedVal or "yes" == $trimmedVal or "on" == $trimmedVal) {
+				return true;
+			} else if ("" == $trimmedVal or "0" == $trimmedVal or "false" == $trimmedVal or "no" == $trimmedVal or "off" == $trimmedVal) {
+				return false;
+			}
 		} elseif (is_bool($value)) {
-		    return $value;
+			return $value;
 		} elseif (is_int($value)) {
-		    return !($value == 0); // true is everything but 0 like in C 
+			return !($value == 0); // true is everything but 0 like in C 
 		}
 		
 		trigger_error("Could not convert ".var_export($value,1)." to boolean!", E_USER_WARNING);
@@ -224,26 +216,26 @@ class LoggerOptionConverter {
 	public static function findAndSubst($key, $props) {
 		$value = @$props[$key];
 
-        // If coming from the LoggerConfiguratorIni, some options were
-        // already mangled by parse_ini_file:
-        //
-        // not specified      => never reaches this code
-        // ""|off|false|null  => string(0) ""
-        // "1"|on|true        => string(1) "1"
-        // "true"             => string(4) "true"
-        // "false"            => string(5) "false"
-        // 
-        // As the integer 1 and the boolean true are therefore indistinguable
-        // it's up to the setter how to deal with it, they can not be cast
-        // into a boolean here. {@see toBoolean}
-        // Even an empty value has to be given to the setter as it has been
-        // explicitly set by the user and is different from an option which
-        // has not been specified and therefore keeps its default value.
-        //
+		// If coming from the LoggerConfiguratorIni, some options were
+		// already mangled by parse_ini_file:
+		//
+		// not specified      => never reaches this code
+		// ""|off|false|null  => string(0) ""
+		// "1"|on|true        => string(1) "1"
+		// "true"             => string(4) "true"
+		// "false"            => string(5) "false"
+		// 
+		// As the integer 1 and the boolean true are therefore indistinguable
+		// it's up to the setter how to deal with it, they can not be cast
+		// into a boolean here. {@see toBoolean}
+		// Even an empty value has to be given to the setter as it has been
+		// explicitly set by the user and is different from an option which
+		// has not been specified and therefore keeps its default value.
+		//
 		// if(!empty($value)) {
 			return LoggerOptionConverter::substVars($value, $props);
 		// }
-    }
+	}
 
 	/**
 	 * Perform variable substitution in string <var>$val</var> from the
@@ -254,7 +246,7 @@ class LoggerOptionConverter {
 	 * <p>For example, if the "MY_CONSTANT" contains "value", then
 	 * the call
 	 * <code>
-	 * $s = LoggerOptionConverter::substituteVars("Value of key is ${MY_CONSTANT}.");
+	 * $s = LoggerOptionConverter::substVars("Value of key is ${MY_CONSTANT}.");
 	 * </code>
 	 * will set the variable <i>$s</i> to "Value of key is value.".</p>
 	 * 
@@ -272,8 +264,6 @@ class LoggerOptionConverter {
 	 * <p>A warn is thrown if <var>$val</var> contains a start delimeter "${" 
 	 * which is not balanced by a stop delimeter "}" and an empty string is returned.</p>
 	 * 
-	 * @author Avy Sharell
-	 * 
 	 * @param string $val The string on which variable substitution is performed.
 	 * @param array $props
 	 * @return string
@@ -302,7 +292,7 @@ class LoggerOptionConverter {
 					// LoggerOptionConverter::substVars() has no closing brace. Opening brace
 					return '';
 				} else {
-					$j += self::START_LEN;
+					$j += self::DELIM_START_LEN;
 					$key = substr($val, $j, $k - $j);
 					// first try in System properties
 					$replacement = LoggerOptionConverter::getSystemProperty($key, null);
@@ -327,4 +317,3 @@ class LoggerOptionConverter {
 	}
 
 }
-?>
diff --git a/libraries/log4php.debug/helpers/LoggerPatternConverter.php b/libraries/log4php.debug/helpers/LoggerPatternConverter.php
index b0c22df1c100706657827979da6995b3011627fc..6a047e89e0a970804c4e8831f7438f8b4ce0bc37 100644
--- a/libraries/log4php.debug/helpers/LoggerPatternConverter.php
+++ b/libraries/log4php.debug/helpers/LoggerPatternConverter.php
@@ -18,24 +18,6 @@
  * @package log4php
  */
 
-/**
- * Array for fast space padding
- * Used by {@link LoggerPatternConverter::spacePad()}.	
- * 
- * @package log4php
- * @subpackage helpers
- */
-
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-$GLOBALS['log4php.LoggerPatternConverter.spaces'] = array(
-	" ", // 1 space
-	"  ", // 2 spaces
-	"    ", // 4 spaces
-	"        ", // 8 spaces
-	"                ", // 16 spaces
-	"                                " ); // 32 spaces
-
 
 /**
  * LoggerPatternConverter is an abstract class that provides the formatting 
@@ -45,14 +27,26 @@ $GLOBALS['log4php.LoggerPatternConverter.spaces'] = array(
  * individual PatternConverters. Each of which is responsible for
  * converting a logging event in a converter specific manner.</p>
  * 
- * @version $Revision: 822445 $
+ * @version $Revision: 925973 $
  * @package log4php
  * @subpackage helpers
  * @abstract
  * @since 0.3
  */
 class LoggerPatternConverter {
-
+	
+	/**
+	 * Array for fast space padding
+	 * Used by {@link LoggerPatternConverter::spacePad()}.	
+	 */
+	private $spaces = array(
+		" ", // 1 space
+		"  ", // 2 spaces
+		"    ", // 4 spaces
+		"        ", // 8 spaces
+		"                ", // 16 spaces
+		"                                "); // 32 spaces 
+	 
 	/**
 	 * @var LoggerPatternConverter next converter in converter chain
 	 */
@@ -119,378 +113,23 @@ class LoggerPatternConverter {
 	/**
 	 * Fast space padding method.
 	 *
-	 * @param string	$sbuf	   string buffer
+	 * @param string	&$sbuf	   string buffer
 	 * @param integer	$length	   pad length
 	 *
 	 * @todo reimplement using PHP string functions
 	 */
-	public function spacePad($sbuf, $length) {
+	public function spacePad(&$sbuf, $length) {
 		while($length >= 32) {
-		  $sbuf .= $GLOBALS['log4php.LoggerPatternConverter.spaces'][5];
+		  $sbuf .= $this->spaces[5];
 		  $length -= 32;
 		}
 		
 		for($i = 4; $i >= 0; $i--) {	
 			if(($length & (1<<$i)) != 0) {
-				$sbuf .= $GLOBALS['log4php.LoggerPatternConverter.spaces'][$i];
+				$sbuf .= $this->spaces[$i];
 			}
 		}
 
 		// $sbuf = str_pad($sbuf, $length);
 	}
 }
-
-// ---------------------------------------------------------------------
-//                      PatternConverters
-// ---------------------------------------------------------------------
-
-/**
- * @author VxR <vxr@vxr.it>
- * @package log4php
- * @subpackage helpers
- */
-class LoggerBasicPatternConverter extends LoggerPatternConverter {
-
-    /**
-     * @var integer
-     */
-    var $type;
-
-    /**
-     * Constructor
-     *
-     * @param string $formattingInfo
-     * @param integer $type
-     */
-    function LoggerBasicPatternConverter($formattingInfo, $type)
-    {
-      LoggerLog::debug("LoggerBasicPatternConverter::LoggerBasicPatternConverter() type='$type'");    
-    
-      $this->LoggerPatternConverter($formattingInfo);
-      $this->type = $type;
-    }
-
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    function convert($event)
-    {
-        switch($this->type) {
-            case LOG4PHP_LOGGER_PATTERN_PARSER_RELATIVE_TIME_CONVERTER:
-                $timeStamp = $event->getTimeStamp();
-                $startTime = LoggerLoggingEvent::getStartTime();
-	            return (string)(int)($timeStamp * 1000 - $startTime * 1000);
-                
-            case LOG4PHP_LOGGER_PATTERN_PARSER_THREAD_CONVERTER:
-	            return $event->getThreadName();
-
-            case LOG4PHP_LOGGER_PATTERN_PARSER_LEVEL_CONVERTER:
-                $level = $event->getLevel();
-	            return $level->toString();
-
-            case LOG4PHP_LOGGER_PATTERN_PARSER_NDC_CONVERTER:
-	            return $event->getNDC();
-
-            case LOG4PHP_LOGGER_PATTERN_PARSER_MESSAGE_CONVERTER:
-	            return $event->getRenderedMessage();
-                
-            default: 
-                return '';
-        }
-    }
-}
-
-/**
- * @author VxR <vxr@vxr.it>
- * @package log4php
- * @subpackage helpers
- */
-class LoggerLiteralPatternConverter extends LoggerPatternConverter {
-    
-    /**
-     * @var string
-     */
-    var $literal;
-
-    /**
-     * Constructor
-     *
-     * @param string $value
-     */
-    function LoggerLiteralPatternConverter($value)
-    {
-        LoggerLog::debug("LoggerLiteralPatternConverter::LoggerLiteralPatternConverter() value='$value'");    
-    
-        $this->literal = $value;
-    }
-
-    /**
-     * @param string &$sbuf
-     * @param LoggerLoggingEvent $event
-     */
-    function format(&$sbuf, $event)
-    {
-        $sbuf .= $this->literal;
-    }
-
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    function convert($event)
-    {
-      return $this->literal;
-    }
-}
-
-/**
- * @author VxR <vxr@vxr.it>
- * @package log4php
- * @subpackage helpers
- */
-class LoggerDatePatternConverter extends LoggerPatternConverter {
-
-    /**
-     * @var string
-     */
-    var $df;
-    
-    /**
-     * Constructor
-     *
-     * @param string $formattingInfo
-     * @param string $df
-     */
-    function LoggerDatePatternConverter($formattingInfo, $df)
-    {
-        LoggerLog::debug("LoggerDatePatternConverter::LoggerDatePatternConverter() dateFormat='$df'");    
-    
-        $this->LoggerPatternConverter($formattingInfo);
-        $this->df = $df;
-    }
-
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    function convert($event)
-    {
-        $timeStamp = $event->getTimeStamp();
-        $usecs = round(($timeStamp - (int)$timeStamp) * 1000);
-        $this->df = str_replace("\u", "u", ereg_replace("[^\\]u", sprintf(',%03d', $usecs), $this->df));
-         
-        return date($this->df, $event->getTimeStamp());
-        
-    }
-}
-
-/**
- * @author VxR <vxr@vxr.it>
- * @package log4php
- * @subpackage helpers
- */
-class LoggerMDCPatternConverter extends LoggerPatternConverter {
-
-    /**
-     * @var string
-     */
-    var $key;
-
-    /**
-     * Constructor
-     *
-     * @param string $formattingInfo
-     * @param string $key
-     */
-    function LoggerMDCPatternConverter($formattingInfo, $key)
-    {
-      LoggerLog::debug("LoggerMDCPatternConverter::LoggerMDCPatternConverter() key='$key'");    
-
-      $this->LoggerPatternConverter($formattingInfo);
-      $this->key = $key;
-    }
-
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    function convert($event)
-    {
-        return $event->getMDC($this->key);
-    }
-}
-
-/**
- * @author VxR <vxr@vxr.it>
- * @package log4php
- * @subpackage helpers
- */
-class LoggerLocationPatternConverter extends LoggerPatternConverter {
-    
-    /**
-     * @var integer
-     */
-    var $type;
-
-    /**
-     * Constructor
-     *
-     * @param string $formattingInfo
-     * @param integer $type
-     */
-    function LoggerLocationPatternConverter($formattingInfo, $type)
-    {
-      LoggerLog::debug("LoggerLocationPatternConverter::LoggerLocationPatternConverter() type='$type'");    
-    
-      $this->LoggerPatternConverter($formattingInfo);
-      $this->type = $type;
-    }
-
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    function convert($event)
-    {
-        $locationInfo = $event->getLocationInformation();
-        switch($this->type) {
-            case LOG4PHP_LOGGER_PATTERN_PARSER_FULL_LOCATION_CONVERTER:
-	            return $locationInfo->fullInfo;
-            case LOG4PHP_LOGGER_PATTERN_PARSER_METHOD_LOCATION_CONVERTER:
-	            return $locationInfo->getMethodName();
-            case LOG4PHP_LOGGER_PATTERN_PARSER_LINE_LOCATION_CONVERTER:
-	            return $locationInfo->getLineNumber();
-            case LOG4PHP_LOGGER_PATTERN_PARSER_FILE_LOCATION_CONVERTER:
-	            return $locationInfo->getFileName();
-            default: 
-                return '';
-        }
-    }
-}
-
-/**
- * @author VxR <vxr@vxr.it>
- * @package log4php
- * @subpackage helpers
- * @abstract
- */
-class LoggerNamedPatternConverter extends LoggerPatternConverter {
-
-    /**
-     * @var integer
-     */
-    var $precision;
-
-    /**
-     * Constructor
-     *
-     * @param string $formattingInfo
-     * @param integer $precision
-     */
-    function LoggerNamedPatternConverter($formattingInfo, $precision)
-    {
-      LoggerLog::debug("LoggerNamedPatternConverter::LoggerNamedPatternConverter() precision='$precision'");    
-    
-      $this->LoggerPatternConverter($formattingInfo);
-      $this->precision =  $precision;
-    }
-
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     * @abstract
-     */
-    function getFullyQualifiedName($event)
-    { 
-        // abstract
-        return;
-    }
-
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    function convert($event)
-    {
-        $n = $this->getFullyQualifiedName($event);
-        if ($this->precision <= 0) {
-	        return $n;
-        } else {
-	        $len = strlen($n);
-            
-        	// We substract 1 from 'len' when assigning to 'end' to avoid out of
-        	// bounds exception in return r.substring(end+1, len). This can happen if
-        	// precision is 1 and the category name ends with a dot.
-        	$end = $len -1 ;
-        	for($i = $this->precision; $i > 0; $i--) {
-        	    $end = strrpos(substr($n, 0, ($end - 1)), '.');
-        	    if ($end == false)
-        	        return $n;
-        	}
-        	return substr($n, ($end + 1), $len);
-        }
-    }
-}
-
-/**
- * @author VxR <vxr@vxr.it>
- * @package log4php
- * @subpackage helpers
- */
-class LoggerClassNamePatternConverter extends LoggerNamedPatternConverter {
-
-    /**
-     * Constructor
-     *
-     * @param string $formattingInfo
-     * @param integer $precision
-     */
-    function LoggerClassNamePatternConverter($formattingInfo, $precision)
-    {
-        LoggerLog::debug("LoggerClassNamePatternConverter::LoggerClassNamePatternConverter() precision='$precision'");    
-    
-        $this->LoggerNamedPatternConverter($formattingInfo, $precision);
-    }
-
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    function getFullyQualifiedName($event)
-    {
-        return $event->fqcn;
-    }
-}
-
-/**
- * @author VxR <vxr@vxr.it>
- * @package log4php
- * @subpackage helpers
- */
-class LoggerCategoryPatternConverter extends LoggerNamedPatternConverter {
-
-    /**
-     * Constructor
-     *
-     * @param string $formattingInfo
-     * @param integer $precision
-     */
-    function LoggerCategoryPatternConverter($formattingInfo, $precision)
-    {
-        LoggerLog::debug("LoggerCategoryPatternConverter::LoggerCategoryPatternConverter() precision='$precision'");    
-    
-        $this->LoggerNamedPatternConverter($formattingInfo, $precision);
-    }
-
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    function getFullyQualifiedName($event)
-    {
-      return $event->getLoggerName();
-    }
-}
-
-?>
diff --git a/libraries/log4php.debug/helpers/LoggerPatternParser.php b/libraries/log4php.debug/helpers/LoggerPatternParser.php
index db3f72354357592e2f83bbc111400336cc9dac81..912b24d1a3f488b32217df7e7bd4732f4958a888 100644
--- a/libraries/log4php.debug/helpers/LoggerPatternParser.php
+++ b/libraries/log4php.debug/helpers/LoggerPatternParser.php
@@ -18,29 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-if (!defined('LOG4PHP_LINE_SEP')) {
-    if (substr(php_uname(), 0, 7) == "Windows") {
-        /**
-         * @ignore
-         */
-        define('LOG4PHP_LINE_SEP', "\r\n");
-    } else {
-        /**
-         * @ignore
-         */
-        define('LOG4PHP_LINE_SEP', "\n");
-    }
-}
- 
-/**
- */
-require_once(LOG4PHP_DIR . '/helpers/LoggerFormattingInfo.php');
-require_once(LOG4PHP_DIR . '/helpers/LoggerPatternConverter.php');
 /**
  * Most of the work of the {@link LoggerPatternLayout} class 
  * is delegated to the {@link LoggerPatternParser} class.
@@ -48,7 +25,7 @@ require_once(LOG4PHP_DIR . '/helpers/LoggerPatternConverter.php');
  * <p>It is this class that parses conversion patterns and creates
  * a chained list of {@link LoggerPatternConverter} converters.</p>
  * 
- * @version $Revision: 822445 $ 
+ * @version $Revision: 948675 $ 
  * @package log4php
  * @subpackage helpers
  *
@@ -268,7 +245,7 @@ class LoggerPatternParser {
 				$this->currentLiteral = '';
 				break;
 			case 'C':
-				$pc = new LoggerClassNamePatternConverter($this->formattingInfo, $this->extractPrecisionOption());
+				$pc = new LoggerClassNamePatternConverter($this->formattingInfo, self::CLASS_LOCATION_CONVERTER);
 				$this->currentLiteral = '';
 				break;
 			case 'd':
@@ -362,4 +339,3 @@ class LoggerPatternParser {
 	}
 }
 
-?>
diff --git a/libraries/log4php.debug/layouts/LoggerLayoutHtml.php b/libraries/log4php.debug/layouts/LoggerLayoutHtml.php
index eeda02663f2ca89294a540b854db0697c1c83a1b..b58ddd172e8cac935a561c1c0ab4dc55ab61f01d 100644
--- a/libraries/log4php.debug/layouts/LoggerLayoutHtml.php
+++ b/libraries/log4php.debug/layouts/LoggerLayoutHtml.php
@@ -18,16 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
- 
-/**
- */
-require_once(LOG4PHP_DIR . '/LoggerLayout.php');
-require_once(LOG4PHP_DIR . '/LoggerLoggingEvent.php');
-
 /**
  * This layout outputs events in a HTML table.
  *
@@ -52,188 +42,184 @@ require_once(LOG4PHP_DIR . '/LoggerLoggingEvent.php');
  *    0    8318   INFO  root       Hello World!
  * </pre>
  * 
- * @version $Revision: 883108 $
+ * @version $Revision: 1059292 $
  * @package log4php
  * @subpackage layouts
  */
 class LoggerLayoutHtml extends LoggerLayout {
 
-    /**
-     * The <b>LocationInfo</b> option takes a boolean value. By
-     * default, it is set to false which means there will be no location
-     * information output by this layout. If the the option is set to
-     * true, then the file name and line number of the statement
-     * at the origin of the log statement will be output.
-     *
-     * <p>If you are embedding this layout within a {@link LoggerAppenderMail}
-     * or a {@link LoggerAppenderMailEvent} then make sure to set the
-     * <b>LocationInfo</b> option of that appender as well.
-     * @var boolean
-     */
-    private $locationInfo = false;
-    
-    /**
-     * The <b>Title</b> option takes a String value. This option sets the
-     * document title of the generated HTML document.
-     * Defaults to 'Log4php Log Messages'.
-     * @var string
-     */
-    private $title = "Log4php Log Messages";
-    
-    /**
-     * Constructor
-     */
-    public function __construct() {
-    }
-    
-    /**
-     * The <b>LocationInfo</b> option takes a boolean value. By
-     * default, it is set to false which means there will be no location
-     * information output by this layout. If the the option is set to
-     * true, then the file name and line number of the statement
-     * at the origin of the log statement will be output.
-     *
-     * <p>If you are embedding this layout within a {@link LoggerAppenderMail}
-     * or a {@link LoggerAppenderMailEvent} then make sure to set the
-     * <b>LocationInfo</b> option of that appender as well.
-     */
-    public function setLocationInfo($flag) {
-        if (is_bool($flag)) {
-            $this->locationInfo = $flag;
-        } else {
-            $this->locationInfo = (bool)(strtolower($flag) == 'true');
-        }
-    }
+	/**
+	 * The <b>LocationInfo</b> option takes a boolean value. By
+	 * default, it is set to false which means there will be no location
+	 * information output by this layout. If the the option is set to
+	 * true, then the file name and line number of the statement
+	 * at the origin of the log statement will be output.
+	 *
+	 * <p>If you are embedding this layout within a {@link LoggerAppenderMail}
+	 * or a {@link LoggerAppenderMailEvent} then make sure to set the
+	 * <b>LocationInfo</b> option of that appender as well.
+	 * @var boolean
+	 */
+	private $locationInfo = false;
+	
+	/**
+	 * The <b>Title</b> option takes a String value. This option sets the
+	 * document title of the generated HTML document.
+	 * Defaults to 'Log4php Log Messages'.
+	 * @var string
+	 */
+	private $title = "Log4php Log Messages";
+	
+	/**
+	 * Constructor
+	 */
+	public function __construct() {
+	}
+	
+	/**
+	 * The <b>LocationInfo</b> option takes a boolean value. By
+	 * default, it is set to false which means there will be no location
+	 * information output by this layout. If the the option is set to
+	 * true, then the file name and line number of the statement
+	 * at the origin of the log statement will be output.
+	 *
+	 * <p>If you are embedding this layout within a {@link LoggerAppenderMail}
+	 * or a {@link LoggerAppenderMailEvent} then make sure to set the
+	 * <b>LocationInfo</b> option of that appender as well.
+	 */
+	public function setLocationInfo($flag) {
+		if (is_bool($flag)) {
+			$this->locationInfo = $flag;
+		} else {
+			$this->locationInfo = (bool)(strtolower($flag) == 'true');
+		}
+	}
 
-    /**
-     * Returns the current value of the <b>LocationInfo</b> option.
-     */
-    public function getLocationInfo() {
-        return $this->locationInfo;
-    }
-    
-    /**
-     * The <b>Title</b> option takes a String value. This option sets the
-     * document title of the generated HTML document.
-     * Defaults to 'Log4php Log Messages'.
-     */
-    public function setTitle($title) {
-        $this->title = $title;
-    }
+	/**
+	 * Returns the current value of the <b>LocationInfo</b> option.
+	 */
+	public function getLocationInfo() {
+		return $this->locationInfo;
+	}
+	
+	/**
+	 * The <b>Title</b> option takes a String value. This option sets the
+	 * document title of the generated HTML document.
+	 * Defaults to 'Log4php Log Messages'.
+	 */
+	public function setTitle($title) {
+		$this->title = $title;
+	}
 
-    /**
-     * @return string Returns the current value of the <b>Title</b> option.
-     */
-    public function getTitle() {
-        return $this->title;
-    }
-    
-    /**
-     * @return string Returns the content type output by this layout, i.e "text/html".
-     */
-    public function getContentType() {
-        return "text/html";
-    }
-    
-    /**
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    public function format(LoggerLoggingEvent $event) {
-        $sbuf = PHP_EOL . "<tr>" . PHP_EOL;
-    
-        $sbuf .= "<td>";
-        $sbuf .= $event->getTime();
-        $sbuf .= "</td>" . PHP_EOL;
-    
-        $sbuf .= "<td title=\"" . $event->getThreadName() . " thread\">";
-        $sbuf .= $event->getThreadName();
-        $sbuf .= "</td>" . PHP_EOL;
-    
-        $sbuf .= "<td title=\"Level\">";
-        
-        $level = $event->getLevel();
-        
-        if ($level->equals(LoggerLevel::getLevelDebug())) {
-          $sbuf .= "<font color=\"#339933\">";
-          $sbuf .= $level->toString();
-          $sbuf .= "</font>";
-        } else if ($level->equals(LoggerLevel::getLevelWarn())) {
-          $sbuf .= "<font color=\"#993300\"><strong>";
-          $sbuf .= $level->toString();
-          $sbuf .= "</strong></font>";
-        } else {
-          $sbuf .= $level->toString();
-        }
-        $sbuf .= "</td>" . PHP_EOL;
-    
-        $sbuf .= "<td title=\"" . htmlentities($event->getLoggerName(), ENT_QUOTES) . " category\">";
-        $sbuf .= htmlentities($event->getLoggerName(), ENT_QUOTES);
-        $sbuf .= "</td>" . PHP_EOL;
-    
-        if ($this->locationInfo) {
-            $locInfo = $event->getLocationInformation();
-            $sbuf .= "<td>";
-            $sbuf .= htmlentities($locInfo->getFileName(), ENT_QUOTES). ':' . $locInfo->getLineNumber();
-            $sbuf .= "</td>" . PHP_EOL;
-        }
+	/**
+	 * @return string Returns the current value of the <b>Title</b> option.
+	 */
+	public function getTitle() {
+		return $this->title;
+	}
+	
+	/**
+	 * @return string Returns the content type output by this layout, i.e "text/html".
+	 */
+	public function getContentType() {
+		return "text/html";
+	}
+	
+	/**
+	 * @param LoggerLoggingEvent $event
+	 * @return string
+	 */
+	public function format(LoggerLoggingEvent $event) {
+		$sbuf = PHP_EOL . "<tr>" . PHP_EOL;
+	
+		$sbuf .= "<td>";
+		$sbuf .= $event->getTime();
+		$sbuf .= "</td>" . PHP_EOL;
+	
+		$sbuf .= "<td title=\"" . $event->getThreadName() . " thread\">";
+		$sbuf .= $event->getThreadName();
+		$sbuf .= "</td>" . PHP_EOL;
+	
+		$sbuf .= "<td title=\"Level\">";
+		
+		$level = $event->getLevel();
+		
+		if ($level->equals(LoggerLevel::getLevelDebug())) {
+			$sbuf .= "<font color=\"#339933\">$level</font>";
+		} else if ($level->equals(LoggerLevel::getLevelWarn())) {
+			$sbuf .= "<font color=\"#993300\"><strong>$level</strong></font>";
+		} else {
+			$sbuf .= $level;
+		}
+		$sbuf .= "</td>" . PHP_EOL;
+	
+		$sbuf .= "<td title=\"" . htmlentities($event->getLoggerName(), ENT_QUOTES) . " category\">";
+		$sbuf .= htmlentities($event->getLoggerName(), ENT_QUOTES);
+		$sbuf .= "</td>" . PHP_EOL;
+	
+		if ($this->locationInfo) {
+			$locInfo = $event->getLocationInformation();
+			$sbuf .= "<td>";
+			$sbuf .= htmlentities($locInfo->getFileName(), ENT_QUOTES). ':' . $locInfo->getLineNumber();
+			$sbuf .= "</td>" . PHP_EOL;
+		}
 
-        $sbuf .= "<td title=\"Message\">";
-        $sbuf .= htmlentities($event->getRenderedMessage(), ENT_QUOTES);
-        $sbuf .= "</td>" . PHP_EOL;
+		$sbuf .= "<td title=\"Message\">";
+		$sbuf .= htmlentities($event->getRenderedMessage(), ENT_QUOTES);
+		$sbuf .= "</td>" . PHP_EOL;
 
-        $sbuf .= "</tr>" . PHP_EOL;
-        
-        if ($event->getNDC() != null) {
-            $sbuf .= "<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" colspan=\"6\" title=\"Nested Diagnostic Context\">";
-            $sbuf .= "NDC: " . htmlentities($event->getNDC(), ENT_QUOTES);
-            $sbuf .= "</td></tr>" . PHP_EOL;
-        }
-        return $sbuf;
-    }
+		$sbuf .= "</tr>" . PHP_EOL;
+		
+		if ($event->getNDC() != null) {
+			$sbuf .= "<tr><td bgcolor=\"#EEEEEE\" style=\"font-size : xx-small;\" colspan=\"6\" title=\"Nested Diagnostic Context\">";
+			$sbuf .= "NDC: " . htmlentities($event->getNDC(), ENT_QUOTES);
+			$sbuf .= "</td></tr>" . PHP_EOL;
+		}
+		return $sbuf;
+	}
 
-    /**
-     * @return string Returns appropriate HTML headers.
-     */
-    public function getHeader() {
-        $sbuf = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" . PHP_EOL;
-        $sbuf .= "<html>" . PHP_EOL;
-        $sbuf .= "<head>" . PHP_EOL;
-        $sbuf .= "<title>" . $this->title . "</title>" . PHP_EOL;
-        $sbuf .= "<style type=\"text/css\">" . PHP_EOL;
-        $sbuf .= "<!--" . PHP_EOL;
-        $sbuf .= "body, table {font-family: arial,sans-serif; font-size: x-small;}" . PHP_EOL;
-        $sbuf .= "th {background: #336699; color: #FFFFFF; text-align: left;}" . PHP_EOL;
-        $sbuf .= "-->" . PHP_EOL;
-        $sbuf .= "</style>" . PHP_EOL;
-        $sbuf .= "</head>" . PHP_EOL;
-        $sbuf .= "<body bgcolor=\"#FFFFFF\" topmargin=\"6\" leftmargin=\"6\">" . PHP_EOL;
-        $sbuf .= "<hr size=\"1\" noshade>" . PHP_EOL;
-        $sbuf .= "Log session start time " . strftime('%c', time()) . "<br>" . PHP_EOL;
-        $sbuf .= "<br>" . PHP_EOL;
-        $sbuf .= "<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" bordercolor=\"#224466\" width=\"100%\">" . PHP_EOL;
-        $sbuf .= "<tr>" . PHP_EOL;
-        $sbuf .= "<th>Time</th>" . PHP_EOL;
-        $sbuf .= "<th>Thread</th>" . PHP_EOL;
-        $sbuf .= "<th>Level</th>" . PHP_EOL;
-        $sbuf .= "<th>Category</th>" . PHP_EOL;
-        if ($this->locationInfo)
-            $sbuf .= "<th>File:Line</th>" . PHP_EOL;
-        $sbuf .= "<th>Message</th>" . PHP_EOL;
-        $sbuf .= "</tr>" . PHP_EOL;
+	/**
+	 * @return string Returns appropriate HTML headers.
+	 */
+	public function getHeader() {
+		$sbuf = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">" . PHP_EOL;
+		$sbuf .= "<html>" . PHP_EOL;
+		$sbuf .= "<head>" . PHP_EOL;
+		$sbuf .= "<title>" . $this->title . "</title>" . PHP_EOL;
+		$sbuf .= "<style type=\"text/css\">" . PHP_EOL;
+		$sbuf .= "<!--" . PHP_EOL;
+		$sbuf .= "body, table {font-family: arial,sans-serif; font-size: x-small;}" . PHP_EOL;
+		$sbuf .= "th {background: #336699; color: #FFFFFF; text-align: left;}" . PHP_EOL;
+		$sbuf .= "-->" . PHP_EOL;
+		$sbuf .= "</style>" . PHP_EOL;
+		$sbuf .= "</head>" . PHP_EOL;
+		$sbuf .= "<body bgcolor=\"#FFFFFF\" topmargin=\"6\" leftmargin=\"6\">" . PHP_EOL;
+		$sbuf .= "<hr size=\"1\" noshade>" . PHP_EOL;
+		$sbuf .= "Log session start time " . strftime('%c', time()) . "<br>" . PHP_EOL;
+		$sbuf .= "<br>" . PHP_EOL;
+		$sbuf .= "<table cellspacing=\"0\" cellpadding=\"4\" border=\"1\" bordercolor=\"#224466\" width=\"100%\">" . PHP_EOL;
+		$sbuf .= "<tr>" . PHP_EOL;
+		$sbuf .= "<th>Time</th>" . PHP_EOL;
+		$sbuf .= "<th>Thread</th>" . PHP_EOL;
+		$sbuf .= "<th>Level</th>" . PHP_EOL;
+		$sbuf .= "<th>Category</th>" . PHP_EOL;
+		if ($this->locationInfo) {
+			$sbuf .= "<th>File:Line</th>" . PHP_EOL;
+		}
+		$sbuf .= "<th>Message</th>" . PHP_EOL;
+		$sbuf .= "</tr>" . PHP_EOL;
 
-        return $sbuf;
-    }
+		return $sbuf;
+	}
 
-    /**
-     * @return string Returns the appropriate HTML footers.
-     */
-    public function getFooter() {
-        $sbuf = "</table>" . PHP_EOL;
-        $sbuf .= "<br>" . PHP_EOL;
-        $sbuf .= "</body></html>";
+	/**
+	 * @return string Returns the appropriate HTML footers.
+	 */
+	public function getFooter() {
+		$sbuf = "</table>" . PHP_EOL;
+		$sbuf .= "<br>" . PHP_EOL;
+		$sbuf .= "</body></html>";
 
-        return $sbuf;
-    }
+		return $sbuf;
+	}
 }
-?>
diff --git a/libraries/log4php.debug/layouts/LoggerLayoutPattern.php b/libraries/log4php.debug/layouts/LoggerLayoutPattern.php
index db0b2e3a88c58948da8d03a14861860489e17e71..6d6d35e1d4efe5a5b654f94a7c993de0e4c655f5 100644
--- a/libraries/log4php.debug/layouts/LoggerLayoutPattern.php
+++ b/libraries/log4php.debug/layouts/LoggerLayoutPattern.php
@@ -130,7 +130,7 @@
  *                                                                then truncate from the beginning.  
  * </pre>
  * 
- * @version $Revision: 883108 $
+ * @version $Revision: 1059292 $
  * @package log4php
  * @subpackage layouts
  * @since 0.3 
@@ -159,7 +159,7 @@ class LoggerLayoutPattern extends LoggerLayout {
 	 */
 	public function __construct($pattern = null) {
 		if ($pattern === null) {
-			$this->pattern = self :: DEFAULT_CONVERSION_PATTERN;
+			$this->setConversionPattern(self::DEFAULT_CONVERSION_PATTERN);
 		} else {
 			$this->pattern = $pattern;
 		}
@@ -192,28 +192,28 @@ class LoggerLayoutPattern extends LoggerLayout {
 		return $sbuf;
 	}
 	
-    /**
-     * Returns an array with the formatted elements.
-     * 
-     * This method is mainly used for the prepared statements of {@see LoggerAppenderPDO}.
-     * 
-     * It requires {@link $this->pattern} to be a comma separated string of patterns like
-     * e.g. <code>%d,%c,%p,%m,%t,%F,%L</code>.
-     * 
-     * @return array(string)   An array of the converted elements i.e. timestamp, message, filename etc.
-     */
-    public function formatToArray(LoggerLoggingEvent $event) {
-        $results = array();
-        $c = $this->head;
-        while ($c !== null) {
-            if ( ! $c instanceOf LoggerLiteralPatternConverter) {
-                $sbuf = null;
-                $c->format($sbuf, $event);
-                $results[] = $sbuf;
-            }
-            $c = $c->next;
-        }
-        return $results;
-    }      
+	/**
+	 * Returns an array with the formatted elements.
+	 * 
+	 * This method is mainly used for the prepared statements of {@see LoggerAppenderPDO}.
+	 * 
+	 * It requires {@link $this->pattern} to be a comma separated string of patterns like
+	 * e.g. <code>%d,%c,%p,%m,%t,%F,%L</code>.
+	 * 
+	 * @return array(string)   An array of the converted elements i.e. timestamp, message, filename etc.
+	 */
+	public function formatToArray(LoggerLoggingEvent $event) {
+		$results = array();
+		$c = $this->head;
+		while ($c !== null) {
+			if ( ! $c instanceOf LoggerLiteralPatternConverter) {
+				$sbuf = null;
+				$c->format($sbuf, $event);
+				$results[] = $sbuf;
+			}
+			$c = $c->next;
+		}
+		return $results;
+	}
 	
-}
\ No newline at end of file
+}
diff --git a/libraries/log4php.debug/layouts/LoggerLayoutSimple.php b/libraries/log4php.debug/layouts/LoggerLayoutSimple.php
index 3859d301d0d4260afda922986a5685defa07387c..8c716e6513f798b32c9b1940a3ebb6fd105b38d0 100644
--- a/libraries/log4php.debug/layouts/LoggerLayoutSimple.php
+++ b/libraries/log4php.debug/layouts/LoggerLayoutSimple.php
@@ -18,15 +18,6 @@
  * @package log4php
  */
 
-/**
- * @ignore 
- */
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-/**
- */
-require_once(LOG4PHP_DIR . '/LoggerLayout.php');
-
 /**
  * A simple layout.
  *
@@ -43,29 +34,29 @@ require_once(LOG4PHP_DIR . '/LoggerLayout.php');
  * 
  * <samp>INFO - Hello World!</samp>
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1059292 $
  * @package log4php
  * @subpackage layouts
  */  
 class LoggerLayoutSimple extends LoggerLayout {
-    /**
-     * Constructor
-     */
-    public function __construct() {
-    }
+	/**
+	 * Constructor
+	 */
+	public function __construct() {
+	}
 
-    /**
-     * Returns the log statement in a format consisting of the
-     * <b>level</b>, followed by " - " and then the
-     * <b>message</b>. For example, 
-     * <samp> INFO - "A message" </samp>
-     *
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    public function format(LoggerLoggingEvent $event) {
-        $level = $event->getLevel();
-        return $level->toString() . ' - ' . $event->getRenderedMessage(). PHP_EOL;
-    }
+	/**
+	 * Returns the log statement in a format consisting of the
+	 * <b>level</b>, followed by " - " and then the
+	 * <b>message</b>. For example, 
+	 * <samp> INFO - "A message" </samp>
+	 *
+	 * @param LoggerLoggingEvent $event
+	 * @return string
+	 */
+	public function format(LoggerLoggingEvent $event) {
+		$level = $event->getLevel();
+		$message = $event->getRenderedMessage();
+		return "$level - $message" . PHP_EOL;
+	}
 }
-?>
diff --git a/libraries/log4php.debug/layouts/LoggerLayoutTTCC.php b/libraries/log4php.debug/layouts/LoggerLayoutTTCC.php
index ae8028001b207cb40e6f3e6a6defef4bf8c808ad..0aa58c48217dadb7684d038727ec350e634b8a8e 100644
--- a/libraries/log4php.debug/layouts/LoggerLayoutTTCC.php
+++ b/libraries/log4php.debug/layouts/LoggerLayoutTTCC.php
@@ -18,11 +18,6 @@
  * @package log4php
  */
 
-if (!defined('LOG4PHP_DIR')) define('LOG4PHP_DIR', dirname(__FILE__) . '/..');
-
-/**
- */
-require_once(LOG4PHP_DIR . '/LoggerLayout.php');
 /**
  * TTCC layout format consists of <b>t</b>ime, <b>t</b>hread, <b>c</b>ategory and nested
  * diagnostic <b>c</b>ontext information, hence the name.
@@ -49,173 +44,158 @@ require_once(LOG4PHP_DIR . '/LoggerLayout.php');
  * The above would print:<br>
  * <samp>02:28 [13714] INFO root - Hello World!</samp>
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1136787 $
  * @package log4php
  * @subpackage layouts
  */
 class LoggerLayoutTTCC extends LoggerLayout {
 
-	/**
-	 * String constant designating no time information. Current value of
-	 * this constant is <b>NULL</b>.
-	 */
-	 // TODO: not used?
-	const LOG4PHP_LOGGER_LAYOUT_NULL_DATE_FORMAT = 'NULL';
+	// Internal representation of options
+	protected $threadPrinting    = true;
+	protected $categoryPrefixing = true;
+	protected $contextPrinting   = true;
+	protected $microSecondsPrinting = true;
 	
 	/**
-	 * String constant designating relative time. Current value of
-	 * this constant is <b>RELATIVE</b>.
+	 * @var string date format. See {@link PHP_MANUAL#strftime} for details
 	 */
-	 // TODO: not used?
-	const LOG4PHP_LOGGER_LAYOUT_RELATIVE_TIME_DATE_FORMAT = 'RELATIVE';
-	
-    // Internal representation of options
-    protected $threadPrinting    = true;
-    protected $categoryPrefixing = true;
-    protected $contextPrinting   = true;
-    protected $microSecondsPrinting = true;
-    
-    /**
-     * @var string date format. See {@link PHP_MANUAL#strftime} for details
-     */
-    protected $dateFormat = '%c';
+	protected $dateFormat = '%c';
 
-    /**
-     * Constructor
-     *
-     * @param string date format
-     * @see dateFormat
-     */
-    public function __construct($dateFormat = '') {
-        if (!empty($dateFormat)) {
-            $this->dateFormat = $dateFormat;
-        }
-        return;
-    }
+	/**
+	 * Constructor
+	 *
+	 * @param string date format
+	 * @see dateFormat
+	 */
+	public function __construct($dateFormat = '') {
+		if (!empty($dateFormat)) {
+			$this->dateFormat = $dateFormat;
+		}
+		return;
+	}
 
-    /**
-     * The <b>ThreadPrinting</b> option specifies whether the name of the
-     * current thread is part of log output or not. This is true by default.
-     */
-    public function setThreadPrinting($threadPrinting) {
-        $this->threadPrinting = is_bool($threadPrinting) ? 
-            $threadPrinting : 
-            (bool)(strtolower($threadPrinting) == 'true'); 
-    }
+	/**
+	 * The <b>ThreadPrinting</b> option specifies whether the name of the
+	 * current thread is part of log output or not. This is true by default.
+	 */
+	public function setThreadPrinting($threadPrinting) {
+		$this->threadPrinting = is_bool($threadPrinting) ? 
+			$threadPrinting : 
+			(bool)(strtolower($threadPrinting) == 'true'); 
+	}
 
-    /**
-     * @return boolean Returns value of the <b>ThreadPrinting</b> option.
-     */
-    public function getThreadPrinting() {
-        return $this->threadPrinting;
-    }
+	/**
+	 * @return boolean Returns value of the <b>ThreadPrinting</b> option.
+	 */
+	public function getThreadPrinting() {
+		return $this->threadPrinting;
+	}
 
-    /**
-     * The <b>CategoryPrefixing</b> option specifies whether {@link Category}
-     * name is part of log output or not. This is true by default.
-     */
-    public function setCategoryPrefixing($categoryPrefixing) {
-        $this->categoryPrefixing = LoggerOptionConverter::toBoolean($categoryPrefixing);
-    }
+	/**
+	 * The <b>CategoryPrefixing</b> option specifies whether {@link Category}
+	 * name is part of log output or not. This is true by default.
+	 */
+	public function setCategoryPrefixing($categoryPrefixing) {
+		$this->categoryPrefixing = LoggerOptionConverter::toBoolean($categoryPrefixing);
+	}
 
-    /**
-     * @return boolean Returns value of the <b>CategoryPrefixing</b> option.
-     */
-    public function getCategoryPrefixing() {
-        return $this->categoryPrefixing;
-    }
+	/**
+	 * @return boolean Returns value of the <b>CategoryPrefixing</b> option.
+	 */
+	public function getCategoryPrefixing() {
+		return $this->categoryPrefixing;
+	}
 
-    /**
-     * The <b>ContextPrinting</b> option specifies log output will include
-     * the nested context information belonging to the current thread.
-     * This is true by default.
-     */
-    public function setContextPrinting($contextPrinting) {
-        $this->contextPrinting = LoggerOptionConverter::toBoolean($contextPrinting); 
-    }
+	/**
+	 * The <b>ContextPrinting</b> option specifies log output will include
+	 * the nested context information belonging to the current thread.
+	 * This is true by default.
+	 */
+	public function setContextPrinting($contextPrinting) {
+		$this->contextPrinting = LoggerOptionConverter::toBoolean($contextPrinting); 
+	}
 
-    /**
-     * @return boolean Returns value of the <b>ContextPrinting</b> option.
-     */
-    public function getContextPrinting() {
-        return $this->contextPrinting;
-    }
-    
-    /**
-     * The <b>MicroSecondsPrinting</b> option specifies if microseconds infos
-     * should be printed at the end of timestamp.
-     * This is true by default.
-     */
-    public function setMicroSecondsPrinting($microSecondsPrinting) {
-        $this->microSecondsPrinting = is_bool($microSecondsPrinting) ? 
-            $microSecondsPrinting : 
-            (bool)(strtolower($microSecondsPrinting) == 'true'); 
-    }
+	/**
+	 * @return boolean Returns value of the <b>ContextPrinting</b> option.
+	 */
+	public function getContextPrinting() {
+		return $this->contextPrinting;
+	}
+	
+	/**
+	 * The <b>MicroSecondsPrinting</b> option specifies if microseconds infos
+	 * should be printed at the end of timestamp.
+	 * This is true by default.
+	 */
+	public function setMicroSecondsPrinting($microSecondsPrinting) {
+		$this->microSecondsPrinting = is_bool($microSecondsPrinting) ? 
+			$microSecondsPrinting : 
+			(bool)(strtolower($microSecondsPrinting) == 'true'); 
+	}
 
-    /**
-     * @return boolean Returns value of the <b>MicroSecondsPrinting</b> option.
-     */
-    public function getMicroSecondsPrinting() {
-        return $this->microSecondsPrinting;
-    }
-    
-    
-    public function setDateFormat($dateFormat) {
-        $this->dateFormat = $dateFormat;
-    }
-    
-    /**
-     * @return string
-     */
-    public function getDateFormat() {
-        return $this->dateFormat;
-    }
+	/**
+	 * @return boolean Returns value of the <b>MicroSecondsPrinting</b> option.
+	 */
+	public function getMicroSecondsPrinting() {
+		return $this->microSecondsPrinting;
+	}
+	
+	
+	public function setDateFormat($dateFormat) {
+		$this->dateFormat = $dateFormat;
+	}
+	
+	/**
+	 * @return string
+	 */
+	public function getDateFormat() {
+		return $this->dateFormat;
+	}
 
-    /**
-     * In addition to the level of the statement and message, the
-     * returned string includes time, thread, category.
-     * <p>Time, thread, category are printed depending on options.
-     *
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    public function format(LoggerLoggingEvent $event) {
-        $timeStamp = (float)$event->getTimeStamp();
-        $format = strftime($this->dateFormat, (int)$timeStamp);
-        
-        if ($this->microSecondsPrinting) {
-            $usecs = floor(($timeStamp - (int)$timeStamp) * 1000);
-            $format .= sprintf(',%03d', $usecs);
-        }
-            
-        $format .= ' ';
-        
-        if ($this->threadPrinting) {
-            $format .= '['.getmypid().'] ';
-        }
-        
-        $level = $event->getLevel();
-        $format .= $level->toString().' ';
-        
-        if($this->categoryPrefixing) {
-            $format .= $event->getLoggerName().' ';
-        }
-       
-        if($this->contextPrinting) {
-            $ndc = $event->getNDC();
-            if($ndc != null) {
-                $format .= $ndc.' ';
-            }
-        }
-        
-        $format .= '- '.$event->getRenderedMessage();
-        $format .= PHP_EOL;
-        
-        return $format;
-    }
+	/**
+	 * In addition to the level of the statement and message, the
+	 * returned string includes time, thread, category.
+	 * <p>Time, thread, category are printed depending on options.
+	 *
+	 * @param LoggerLoggingEvent $event
+	 * @return string
+	 */
+	public function format(LoggerLoggingEvent $event) {
+		$timeStamp = (float)$event->getTimeStamp();
+		$format = strftime($this->dateFormat, (int)$timeStamp);
+		
+		if ($this->microSecondsPrinting) {
+			$usecs = floor(($timeStamp - (int)$timeStamp) * 1000);
+			$format .= sprintf(',%03d', $usecs);
+		}
+			
+		$format .= ' ';
+		
+		if ($this->threadPrinting) {
+			$format .= '['.getmypid().'] ';
+		}
+		
+		$level = $event->getLevel();
+		$format .= $level.' ';
+		
+		if($this->categoryPrefixing) {
+			$format .= $event->getLoggerName().' ';
+		}
+	   
+		if($this->contextPrinting) {
+			$ndc = $event->getNDC();
+			if($ndc != null) {
+				$format .= $ndc.' ';
+			}
+		}
+		
+		$format .= '- '.$event->getRenderedMessage();
+		$format .= PHP_EOL;
+		
+		return $format;
+	}
 
-    public function ignoresThrowable() {
-        return true;
-    }
+	public function ignoresThrowable() {
+		return true;
+	}
 }
-?>
diff --git a/libraries/log4php.debug/layouts/LoggerLayoutXml.php b/libraries/log4php.debug/layouts/LoggerLayoutXml.php
index e9296256c028616a0b770df860153ccb80b810e4..88244a36f4a5d615de9fa5163956e2aead9ede14 100644
--- a/libraries/log4php.debug/layouts/LoggerLayoutXml.php
+++ b/libraries/log4php.debug/layouts/LoggerLayoutXml.php
@@ -36,15 +36,15 @@
  * The above would print:
  * 
  * <pre>
- *   <log4php:eventSet xmlns:log4php="http://logging.apache.org/log4php/" version="0.3" includesLocationInfo="true">
- *     <log4php:event logger="root" level="INFO" thread="13802" timestamp="1252456226491">
- *       <log4php:message><![CDATA[Hello World!]]></log4php:message>
- *       <log4php:locationInfo class="main" file="examples/php/layout_xml.php" line="6" method="main" />
- *     </log4php:event>
- *   </log4php:eventSet>
+ * <log4php:eventSet xmlns:log4php="http://logging.apache.org/log4php/" version="0.3" includesLocationInfo="true">
+ * 	<log4php:event logger="root" level="INFO" thread="13802" timestamp="1252456226491">
+ * 		<log4php:message><![CDATA[Hello World!]]></log4php:message>
+ * 		<log4php:locationInfo class="main" file="examples/php/layout_xml.php" line="6" method="main" />
+ * 	</log4php:event>
+ * </log4php:eventSet>
  * </pre>
  *
- * @version $Revision: 883108 $
+ * @version $Revision: 1059292 $
  * @package log4php
  * @subpackage layouts
  */
@@ -61,124 +61,124 @@ class LoggerLayoutXml extends LoggerLayout {
 
 	const CDATA_EMBEDDED_END = ']]>]]&gt;<![CDATA[';
 
-    /**
-     * If set to true then the file name and line number of the origin of the
-     * log statement will be output.
-     * 
-     * @var boolean
-     */
-    private $locationInfo = true;
+	/**
+	 * If set to true then the file name and line number of the origin of the
+	 * log statement will be output.
+	 * 
+	 * @var boolean
+	 */
+	private $locationInfo = true;
   
-    /**
-     * @var boolean set the elements namespace
-     */
-    private $log4jNamespace = false;
-    
-    
-    /**
-     * @var string namespace
-     * @private
-     */
-    private $_namespace = self::LOG4PHP_NS;
-    
-    /**
-     * @var string namespace prefix
-     * @private
-     */
-    private $_namespacePrefix = self::LOG4PHP_NS_PREFIX;
-     
-    /** 
-     * No options to activate. 
-     */
-    public function activateOptions() {
-        if ($this->getLog4jNamespace()) {
-            $this->_namespace        = self::LOG4J_NS;
-            $this->_namespacePrefix  = self::LOG4J_NS_PREFIX;
-        } else {
-            $this->_namespace        = self::LOG4PHP_NS;
-            $this->_namespacePrefix  = self::LOG4PHP_NS_PREFIX;
-        }     
-    }
-    
-    /**
-     * @return string
-     */
-    public function getHeader() {
-        return "<{$this->_namespacePrefix}:eventSet ".
-                    "xmlns:{$this->_namespacePrefix}=\"{$this->_namespace}\" ".
-                    "version=\"0.3\" ".
-                    "includesLocationInfo=\"".($this->getLocationInfo() ? "true" : "false")."\"".
-               ">\r\n";
-    }
+	/**
+	 * @var boolean set the elements namespace
+	 */
+	private $log4jNamespace = false;
+	
+	
+	/**
+	 * @var string namespace
+	 * @private
+	 */
+	private $_namespace = self::LOG4PHP_NS;
+	
+	/**
+	 * @var string namespace prefix
+	 * @private
+	 */
+	private $_namespacePrefix = self::LOG4PHP_NS_PREFIX;
+	 
+	/** 
+	 * No options to activate. 
+	 */
+	public function activateOptions() {
+		if ($this->getLog4jNamespace()) {
+			$this->_namespace        = self::LOG4J_NS;
+			$this->_namespacePrefix  = self::LOG4J_NS_PREFIX;
+		} else {
+			$this->_namespace        = self::LOG4PHP_NS;
+			$this->_namespacePrefix  = self::LOG4PHP_NS_PREFIX;
+		}
+	}
+	
+	/**
+	 * @return string
+	 */
+	public function getHeader() {
+		return "<{$this->_namespacePrefix}:eventSet ".
+					"xmlns:{$this->_namespacePrefix}=\"{$this->_namespace}\" ".
+					"version=\"0.3\" ".
+					"includesLocationInfo=\"".($this->getLocationInfo() ? "true" : "false")."\"".
+					">\r\n";
+	}
 
-    /**
-     * Formats a {@link LoggerLoggingEvent} in conformance with the log4php.dtd.
-     *
-     * @param LoggerLoggingEvent $event
-     * @return string
-     */
-    public function format(LoggerLoggingEvent $event) {
-    	$loggerName = $event->getLoggerName();
-        $timeStamp  = number_format((float)($event->getTimeStamp() * 1000), 0, '', '');
-        $thread     = $event->getThreadName();
-        $level      = $event->getLevel();
-        $levelStr   = $level->toString();
+	/**
+	 * Formats a {@link LoggerLoggingEvent} in conformance with the log4php.dtd.
+	 *
+	 * @param LoggerLoggingEvent $event
+	 * @return string
+	 */
+	public function format(LoggerLoggingEvent $event) {
+		$loggerName = $event->getLoggerName();
+		$timeStamp  = number_format((float)($event->getTimeStamp() * 1000), 0, '', '');
+		$thread     = $event->getThreadName();
+		$level      = $event->getLevel();
+		$levelStr   = $level->toString();
 
-        $buf = "<{$this->_namespacePrefix}:event logger=\"{$loggerName}\" level=\"{$levelStr}\" thread=\"{$thread}\" timestamp=\"{$timeStamp}\">".PHP_EOL;
-        $buf .= "<{$this->_namespacePrefix}:message><![CDATA["; 
-        $this->appendEscapingCDATA($buf, $event->getRenderedMessage()); 
-        $buf .= "]]></{$this->_namespacePrefix}:message>".PHP_EOL;        
+		$buf = "<{$this->_namespacePrefix}:event logger=\"{$loggerName}\" level=\"{$levelStr}\" thread=\"{$thread}\" timestamp=\"{$timeStamp}\">".PHP_EOL;
+		$buf .= "<{$this->_namespacePrefix}:message><![CDATA["; 
+		$this->appendEscapingCDATA($buf, $event->getRenderedMessage()); 
+		$buf .= "]]></{$this->_namespacePrefix}:message>".PHP_EOL;
 
-        $ndc = $event->getNDC();
-        if($ndc != null) {
-            $buf .= "<{$this->_namespacePrefix}:NDC><![CDATA[";
-            $this->appendEscapingCDATA($buf, $ndc);
-            $buf .= "]]></{$this->_namespacePrefix}:NDC>".PHP_EOL;       
-        }
+		$ndc = $event->getNDC();
+		if($ndc != null) {
+			$buf .= "<{$this->_namespacePrefix}:NDC><![CDATA[";
+			$this->appendEscapingCDATA($buf, $ndc);
+			$buf .= "]]></{$this->_namespacePrefix}:NDC>".PHP_EOL;
+		}
 
-        if ($this->getLocationInfo()) {
-            $locationInfo = $event->getLocationInformation();
-            $buf .= "<{$this->_namespacePrefix}:locationInfo ". 
-                    "class=\"" . $locationInfo->getClassName() . "\" ".
-                    "file=\"" .  htmlentities($locationInfo->getFileName(), ENT_QUOTES) . "\" ".
-                    "line=\"" .  $locationInfo->getLineNumber() . "\" ".
-                    "method=\"" . $locationInfo->getMethodName() . "\" ";
-            $buf .= "/>".PHP_EOL;
+		if ($this->getLocationInfo()) {
+			$locationInfo = $event->getLocationInformation();
+			$buf .= "<{$this->_namespacePrefix}:locationInfo ". 
+					"class=\"" . $locationInfo->getClassName() . "\" ".
+					"file=\"" .  htmlentities($locationInfo->getFileName(), ENT_QUOTES) . "\" ".
+					"line=\"" .  $locationInfo->getLineNumber() . "\" ".
+					"method=\"" . $locationInfo->getMethodName() . "\" ";
+			$buf .= "/>".PHP_EOL;
 
-        }
+		}
 
-        $buf .= "</{$this->_namespacePrefix}:event>".PHP_EOL.PHP_EOL;
-        
-        return $buf;
+		$buf .= "</{$this->_namespacePrefix}:event>".PHP_EOL.PHP_EOL;
+		
+		return $buf;
 
-    }
-    
-    /**
-     * @return string
-     */
-    public function getFooter() {
-        return "</{$this->_namespacePrefix}:eventSet>\r\n";
-    }
-    
-    
-    /** Whether or not file name and line number will be included in the output.
-     * 
-     * @return boolean
-     */
-    public function getLocationInfo() {
-        return $this->locationInfo;
-    }
+	}
+	
+	/**
+	 * @return string
+	 */
+	public function getFooter() {
+		return "</{$this->_namespacePrefix}:eventSet>\r\n";
+	}
+	
+	
+	/** Whether or not file name and line number will be included in the output.
+	 * 
+	 * @return boolean
+	 */
+	public function getLocationInfo() {
+		return $this->locationInfo;
+	}
   
-    /**
-     * The {@link $locationInfo} option takes a boolean value. By default,
-     * it is set to false which means there will be no location
-     * information output by this layout. If the the option is set to
-     * true, then the file name and line number of the statement at the
-     * origin of the log statement will be output.
-     */
-    public function setLocationInfo($flag) {
-        $this->locationInfo = LoggerOptionConverter::toBoolean($flag, true);
-    }
+	/**
+	 * The {@link $locationInfo} option takes a boolean value. By default,
+	 * it is set to false which means there will be no location
+	 * information output by this layout. If the the option is set to
+	 * true, then the file name and line number of the statement at the
+	 * origin of the log statement will be output.
+	 */
+	public function setLocationInfo($flag) {
+		$this->locationInfo = LoggerOptionConverter::toBoolean($flag, true);
+	}
   
 	/**
 	 * @return boolean
@@ -187,14 +187,14 @@ class LoggerLayoutXml extends LoggerLayout {
 	 	return $this->log4jNamespace;
 	 }
 
-    /**
-     * @param boolean
-     */
-    public function setLog4jNamespace($flag) {
-        $this->log4jNamespace = LoggerOptionConverter::toBoolean($flag, true);
-    }
-    
-    /**
+	/**
+	 * @param boolean
+	 */
+	public function setLog4jNamespace($flag) {
+		$this->log4jNamespace = LoggerOptionConverter::toBoolean($flag, true);
+	}
+	
+	/**
 	 * Ensures that embeded CDEnd strings (]]&gt;) are handled properly
 	 * within message, NDC and throwable tag text.
 	 *
diff --git a/libraries/log4php.debug/renderers/LoggerRendererException.php b/libraries/log4php.debug/renderers/LoggerRendererException.php
new file mode 100644
index 0000000000000000000000000000000000000000..f9134a9c42b81c175b70e734775a69b135448c75
--- /dev/null
+++ b/libraries/log4php.debug/renderers/LoggerRendererException.php
@@ -0,0 +1,41 @@
+<?php
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *	   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * @package log4php
+ */
+
+/**
+ * Exception renderer
+ *
+ * @package log4php
+ * @subpackage renderers
+ * @since 2.1
+ */
+class LoggerRendererException implements LoggerRendererObject {
+
+	public function render($o) {
+		$strRep  = 'Throwable('.get_class($o).'): '.$o->getMessage().' in '.$o->getFile().' on line '.$o->getLine();
+		$strRep .= PHP_EOL.$o->getTraceAsString();
+		
+		if (method_exists($o, 'getPrevious') && $o->getPrevious() !== null) {
+			$strRep .= PHP_EOL.'Caused by: '.$this->render($o->getPrevious());
+		}
+		
+		return $strRep;		
+	}
+}
+?>
\ No newline at end of file
diff --git a/libraries/log4php.debug/renderers/LoggerRendererMap.php b/libraries/log4php.debug/renderers/LoggerRendererMap.php
index 39fe9c5f7a4779fbfcab5cda5635b77529c6e853..c6ed4efb1f55fc40dd0952466b4fb4538fe83186 100644
--- a/libraries/log4php.debug/renderers/LoggerRendererMap.php
+++ b/libraries/log4php.debug/renderers/LoggerRendererMap.php
@@ -29,7 +29,7 @@
  * DEBUG - Doe, John
  * </pre>
  * 
- * @version $Revision: 883108 $
+ * @version $Revision: 1125335 $
  * @package log4php
  * @subpackage renderers
  * @since 0.3
@@ -126,7 +126,8 @@ class LoggerRendererMap {
 	 */
 	public function getByClassName($class) {
 		$r = null;
-		for($c = strtolower($class); !empty($c); $c = get_parent_class($c)) {
+		for($c = $class; !empty($c); $c = get_parent_class($c)) {
+			$c = strtolower($c);
 			if(isset($this->map[$c])) {
 				return $this->map[$c];
 			}