logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject svn commit: r1374777 - /logging/log4php/trunk/src/main/php/LoggerAppender.php
Date Sun, 19 Aug 2012 15:53:21 GMT
Author: ihabunek
Date: Sun Aug 19 15:53:20 2012
New Revision: 1374777

URL: http://svn.apache.org/viewvc?rev=1374777&view=rev
Log:
Removed usage of register_shutdown_function which was used instead of  a distructor in LoggerAppender.
This function yielded some unexpected and undesirable behaviour.

Modified:
    logging/log4php/trunk/src/main/php/LoggerAppender.php

Modified: logging/log4php/trunk/src/main/php/LoggerAppender.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/main/php/LoggerAppender.php?rev=1374777&r1=1374776&r2=1374777&view=diff
==============================================================================
--- logging/log4php/trunk/src/main/php/LoggerAppender.php (original)
+++ logging/log4php/trunk/src/main/php/LoggerAppender.php Sun Aug 19 15:53:20 2012
@@ -75,16 +75,16 @@ abstract class LoggerAppender extends Lo
 	 */
 	public function __construct($name = '') {
 		$this->name = $name;
-		
-		// Closes the appender on shutdown. Better than a destructor because
-		// it will be called even if a fatal error occurs (destructor won't).
-		register_shutdown_function(array($this, 'close'));
-		
+
 		if ($this->requiresLayout) {
 			$this->layout = $this->getDefaultLayout();
 		}
 	}
 	
+	public function __destruct() {
+		$this->close();
+	}
+	
 	/**
 	 * Returns the default layout for this appender. Can be overriden by 
 	 * derived appenders.



Mime
View raw message