Revert "BUG-13506 Corrección de formato"

This reverts commit 751efeb4fc2c872f0f0c9569949473618848d65e.
This commit is contained in:
Roly Rudy Gutierrez Pinto
2013-11-25 17:47:08 -04:00
parent d49dd2a940
commit dc7e950351
3 changed files with 9 additions and 11 deletions

View File

@@ -5261,7 +5261,7 @@ class G
$config = System::getSystemConfiguration(); $config = System::getSystemConfiguration();
G::LoadSystem('logger'); G::LoadSystem('logger');
$oLogger =& Logger::getSingleton($pathData, PATH_SEP, $file); $oLogger = logger::getSingleton($pathData, PATH_SEP, $file);
$oLogger->limitFile = $config['number_log_file']; $oLogger->limitFile = $config['number_log_file'];
$oLogger->limitSize = $config['size_log_file']; $oLogger->limitSize = $config['size_log_file'];
$oLogger->write($message); $oLogger->write($message);

View File

@@ -14,7 +14,7 @@
* @author Roly Rudy Gutierrez Pinto * @author Roly Rudy Gutierrez Pinto
* @package gulliver.system * @package gulliver.system
*/ */
class Logger class logger
{ {
public static $instance = null; public static $instance = null;
@@ -31,10 +31,10 @@ class Logger
{ {
$this->limitFile = 5; $this->limitFile = 5;
$this->limitSize = 1000000; $this->limitSize = 1000000;
$filename = pathinfo($file); $filename = explode(".", $file);
if (isset($filename['filename']) && isset($filename['extension'])) { if (isset($filename[0]) && isset($filename[1])) {
$this->fileName = $filename['filename']; $this->fileName = $filename[0];
$this->fileExtension = '.' . $filename['extension']; $this->fileExtension = '.' . $filename[1];
} else { } else {
$this->fileName = 'cron'; $this->fileName = 'cron';
$this->fileExtension = '.log'; $this->fileExtension = '.log';
@@ -49,7 +49,7 @@ class Logger
public function getSingleton($pathData, $pathSep, $file = 'cron.log') public function getSingleton($pathData, $pathSep, $file = 'cron.log')
{ {
if (self::$instance == null) { if (self::$instance == null) {
self::$instance = new Logger($pathData, $pathSep, $file); self::$instance = new logger($pathData, $pathSep, $file);
} }
return self::$instance; return self::$instance;
} }

View File

@@ -1417,15 +1417,13 @@ class workspaceTools
public function backupLogFiles() public function backupLogFiles()
{ {
$config = System::getSystemConfiguration();
clearstatcache(); clearstatcache();
$path = PATH_DATA . "log" . PATH_SEP; $path = PATH_DATA . "log" . PATH_SEP;
$filePath = $path . "cron.log"; $filePath = $path . "cron.log";
if (file_exists($filePath)) { if (file_exists($filePath)) {
$size = filesize($filePath); $size = filesize($filePath);
/* $config['size_log_file'] has the value 5000000 -> approximately 5 megabytes */ /* 5000000 -> approximately 5 megabytes */
if ($size > $config['size_log_file']) { if ($size > 5000000) {
rename($filePath, $filePath . ".bak"); rename($filePath, $filePath . ".bak");
} }
} }