using clearstatchache
authorChristian Grobmeier <grobmeier@apache.org>
Wed, 8 Jun 2011 09:53:39 +0000 (09:53 +0000)
committerChristian Grobmeier <grobmeier@apache.org>
Wed, 8 Jun 2011 09:53:39 +0000 (09:53 +0000)
git-svn-id: https://svn.apache.org/repos/asf/logging/log4php/trunk@1133318 13f79535-47bb-0310-9956-ffa450edef68

src/main/php/appenders/LoggerAppenderRollingFile.php

index 885a893..947aa04 100644 (file)
@@ -222,13 +222,13 @@ class LoggerAppenderRollingFile extends LoggerAppenderFile {
         */
        public function append(LoggerLoggingEvent $event) {
                parent::append($event);
-               if(ftell($this->fp) > $this->getMaxFileSize()) { 
-                       if(flock($this->fp, LOCK_EX)) { 
-                               if(ftell($this->fp) > $this->getMaxFileSize()) { 
-                                       $this->rollOver(); 
-                               }
+               if((ftell($this->fp) > $this->getMaxFileSize()) && flock($this->fp, LOCK_EX)) {
+                       clearstatcache();
+                       if(ftell($this->fp) > $this->getMaxFileSize()) { 
+                               $this->rollOver(); 
                        }
                }
+               
        }
        
        /**