Revert "BUG-13506 Corrección de formato"
This reverts commit 751efeb4fc2c872f0f0c9569949473618848d65e.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user