IMPROVEMENT in method log from class G
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
/**
|
||||
* class.logger.php
|
||||
* Stores a message in the log file, if the file size exceeds
|
||||
* Stores a message in the log file, if the file size exceeds
|
||||
* specified log file is renamed and a new one is created.
|
||||
* $fileName = "filename";
|
||||
* $fileExtension = ".log";
|
||||
@@ -10,7 +10,7 @@
|
||||
* $limitSize = 1000000;
|
||||
* 10000000 -> approximately 10 megabytes
|
||||
* 1000000 -> approximately 1 megabytes
|
||||
*
|
||||
*
|
||||
* @author Roly Rudy Gutierrez Pinto
|
||||
* @package gulliver.system
|
||||
*/
|
||||
@@ -103,7 +103,7 @@ class Logger
|
||||
{
|
||||
$this->renameFile();
|
||||
$file = fopen($this->filePath, "a+");
|
||||
$message = date('Y-m-d H:i:s') . " " . $message;
|
||||
$message = date('Y-m-d H:i:s') . " " . $message . "\n";
|
||||
fwrite($file, $message);
|
||||
fclose($file);
|
||||
}
|
||||
|
||||
@@ -950,7 +950,7 @@ function saveLog($sSource, $sType, $sDescription)
|
||||
}
|
||||
|
||||
G::verifyPath(PATH_DATA . "log" . PATH_SEP, true);
|
||||
G::log("| $sObject | " . $sSource . " | $sType | " . $sDescription . "\n", PATH_DATA);
|
||||
G::log("| $sObject | " . $sSource . " | $sType | " . $sDescription, PATH_DATA);
|
||||
} catch (Exception $e) {
|
||||
//CONTINUE
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ function saveLog($sSource, $sType, $sDescription)
|
||||
print date ('H:i:s') . " ($sSource) $sType $sDescription <br>\n";
|
||||
|
||||
G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true);
|
||||
$message = '(' . $sSource . ') ' . $sDescription . "\n";
|
||||
$message = '(' . $sSource . ') ' . $sDescription;
|
||||
if ($sType == 'action') {
|
||||
G::log($message, PATH_DATA);
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ function saveLog($sSource, $sType, $sDescription)
|
||||
print date ('H:i:s') . " ($sSource) $sType $sDescription <br>\n";
|
||||
|
||||
G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true);
|
||||
$message = '(' . $sSource . ') ' . $sDescription . "\n";
|
||||
$message = '(' . $sSource . ') ' . $sDescription;
|
||||
if ($sType == 'action') {
|
||||
G::log($message, PATH_DATA);
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ try {
|
||||
}
|
||||
//Log failed authentications
|
||||
$message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . SYS_SYS;
|
||||
$message .= " | BROWSER: " . $_SERVER['HTTP_USER_AGENT'] ." | \n" ;
|
||||
$message .= " | BROWSER: " . $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
G::log($message, PATH_DATA, 'loginFailed.log');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user