diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 3929e66c8..05346a18b 100755 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -5261,7 +5261,7 @@ class G $config = System::getSystemConfiguration(); G::LoadSystem('logger'); - $oLogger =& Logger::getSingleton($pathData, PATH_SEP, $file); + $oLogger = logger::getSingleton($pathData, PATH_SEP, $file); $oLogger->limitFile = $config['number_log_file']; $oLogger->limitSize = $config['size_log_file']; $oLogger->write($message); diff --git a/gulliver/system/class.logger.php b/gulliver/system/class.logger.php index 46cd0c43a..8827a6259 100644 --- a/gulliver/system/class.logger.php +++ b/gulliver/system/class.logger.php @@ -14,7 +14,7 @@ * @author Roly Rudy Gutierrez Pinto * @package gulliver.system */ -class Logger +class logger { public static $instance = null; @@ -31,10 +31,10 @@ class Logger { $this->limitFile = 5; $this->limitSize = 1000000; - $filename = pathinfo($file); - if (isset($filename['filename']) && isset($filename['extension'])) { - $this->fileName = $filename['filename']; - $this->fileExtension = '.' . $filename['extension']; + $filename = explode(".", $file); + if (isset($filename[0]) && isset($filename[1])) { + $this->fileName = $filename[0]; + $this->fileExtension = '.' . $filename[1]; } else { $this->fileName = 'cron'; $this->fileExtension = '.log'; @@ -49,7 +49,7 @@ class Logger public function getSingleton($pathData, $pathSep, $file = 'cron.log') { if (self::$instance == null) { - self::$instance = new Logger($pathData, $pathSep, $file); + self::$instance = new logger($pathData, $pathSep, $file); } return self::$instance; } diff --git a/workflow/engine/classes/class.wsTools.php b/workflow/engine/classes/class.wsTools.php index 1ca256a6d..2f771435d 100755 --- a/workflow/engine/classes/class.wsTools.php +++ b/workflow/engine/classes/class.wsTools.php @@ -1417,15 +1417,13 @@ class workspaceTools public function backupLogFiles() { - $config = System::getSystemConfiguration(); - clearstatcache(); $path = PATH_DATA . "log" . PATH_SEP; $filePath = $path . "cron.log"; if (file_exists($filePath)) { $size = filesize($filePath); - /* $config['size_log_file'] has the value 5000000 -> approximately 5 megabytes */ - if ($size > $config['size_log_file']) { + /* 5000000 -> approximately 5 megabytes */ + if ($size > 5000000) { rename($filePath, $filePath . ".bak"); } }