IMPROVEMENT in method log from class G
This commit is contained in:
@@ -103,7 +103,7 @@ class Logger
|
|||||||
{
|
{
|
||||||
$this->renameFile();
|
$this->renameFile();
|
||||||
$file = fopen($this->filePath, "a+");
|
$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);
|
fwrite($file, $message);
|
||||||
fclose($file);
|
fclose($file);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -950,7 +950,7 @@ function saveLog($sSource, $sType, $sDescription)
|
|||||||
}
|
}
|
||||||
|
|
||||||
G::verifyPath(PATH_DATA . "log" . PATH_SEP, true);
|
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) {
|
} catch (Exception $e) {
|
||||||
//CONTINUE
|
//CONTINUE
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -350,7 +350,7 @@ function saveLog($sSource, $sType, $sDescription)
|
|||||||
print date ('H:i:s') . " ($sSource) $sType $sDescription <br>\n";
|
print date ('H:i:s') . " ($sSource) $sType $sDescription <br>\n";
|
||||||
|
|
||||||
G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true);
|
G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true);
|
||||||
$message = '(' . $sSource . ') ' . $sDescription . "\n";
|
$message = '(' . $sSource . ') ' . $sDescription;
|
||||||
if ($sType == 'action') {
|
if ($sType == 'action') {
|
||||||
G::log($message, PATH_DATA);
|
G::log($message, PATH_DATA);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -499,7 +499,7 @@ function saveLog($sSource, $sType, $sDescription)
|
|||||||
print date ('H:i:s') . " ($sSource) $sType $sDescription <br>\n";
|
print date ('H:i:s') . " ($sSource) $sType $sDescription <br>\n";
|
||||||
|
|
||||||
G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true);
|
G::verifyPath (PATH_DATA . 'log' . PATH_SEP, true);
|
||||||
$message = '(' . $sSource . ') ' . $sDescription . "\n";
|
$message = '(' . $sSource . ') ' . $sDescription;
|
||||||
if ($sType == 'action') {
|
if ($sType == 'action') {
|
||||||
G::log($message, PATH_DATA);
|
G::log($message, PATH_DATA);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ try {
|
|||||||
}
|
}
|
||||||
//Log failed authentications
|
//Log failed authentications
|
||||||
$message = "| Many failed authentication attempts for USER: " . $usr . " | IP: " . G::getIpAddress() . " | WS: " . SYS_SYS;
|
$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');
|
G::log($message, PATH_DATA, 'loginFailed.log');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user