add OS to log data
This commit is contained in:
1 parent
5112e70dd1
commit
40e14af0de
2 files changed
+5
-4
No files matched your search
@@ -78,7 +78,10 @@
|
||||
// Собираем информацию об окружении
|
||||
$logEnv = '';
|
||||
if ($addEnv) {
|
||||
$env = ['ip' => SystemFunctions::getIP()];
|
||||
$env = [
|
||||
'ip' => SystemFunctions::getIP(),
|
||||
'os' => SystemFunctions::getOS(),
|
||||
];
|
||||
|
||||
$userId = User::getUserId();
|
||||
if (!empty($userId)) {
|
||||
@@ -86,7 +89,6 @@
|
||||
$env['userId'] = $arUserData['id'];
|
||||
$env['userLogin'] = $arUserData['login'];
|
||||
}
|
||||
|
||||
$env['memory'] = memory_get_usage(true);
|
||||
|
||||
$_SERVER['SERVER_NAME'] = $_SERVER['SERVER_NAME'] ?? gethostname();
|
||||
@@ -103,7 +105,7 @@
|
||||
|
||||
$logText .= $logContent;
|
||||
|
||||
if (false === $logTextPosEOL) {
|
||||
if ($logTextPosEOL === false) {
|
||||
$logText .= $logEnv;
|
||||
} else {
|
||||
$logText = preg_replace('/\n/', $logEnv . PHP_EOL, $logText, 1);
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
/*$userId = User::registration('test', '12345', 'support@it-stories.ru', 'user', 'Тестировщик', 'http://samag.ru/uploads/5222447.png');
|
||||
$user = new User($userId);*/
|
||||
|
||||
Log::logToFile('Проверка работы файлового лога', 'test.log');
|
||||
$userId = 2;//User::getUserId();
|
||||
try {
|
||||
$user = new User($userId);
|
||||
|
||||
Reference in new issue
Block a user