logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ihabu...@apache.org
Subject svn commit: r1334608 - /logging/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php
Date Sun, 06 May 2012 11:38:35 GMT
Author: ihabunek
Date: Sun May  6 11:38:35 2012
New Revision: 1334608

URL: http://svn.apache.org/viewvc?rev=1334608&view=rev
Log:
LoggerAppenderRollingFile: Fixed bug which prevented compression from working on windows.
Better error message.

Modified:
    logging/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php

Modified: logging/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php
URL: http://svn.apache.org/viewvc/logging/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php?rev=1334608&r1=1334607&r2=1334608&view=diff
==============================================================================
--- logging/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php (original)
+++ logging/log4php/trunk/src/main/php/appenders/LoggerAppenderRollingFile.php Sun May  6
11:38:35 2012
@@ -138,7 +138,7 @@ class LoggerAppenderRollingFile extends 
 			$this->renameArchievedLogs($fileName);
 	
 			if (true === $this->compress) {
-				file_put_contents('compress.zlib:///'.$fileName.'.1.gz', file_get_contents($fileName));
+				file_put_contents('compress.zlib://'.$fileName.'.1.gz', file_get_contents($fileName));
 			} else {
 				// Backup the active file
 				copy($fileName, "$fileName.1");				
@@ -246,10 +246,9 @@ class LoggerAppenderRollingFile extends 
 	public function activateOptions() {
 		parent::activateOptions();
 		
-		if ($this->compress == true && !function_exists('gzcompress')) {
+		if ($this->compress == true && !extension_loaded('zlib')) {
+			$this->warn('The zlib extension is required for file-compression');
 			$this->closed = true;
-			
-			$this->warn('zlib is required for file-compression');
 		}
 	}
 	



Mime
View raw message