diff --git a/core/lib/Core/Helpers/Log.class.php b/core/lib/Core/Helpers/Log.class.php index 8f87bd7..4cb7625 100644 --- a/core/lib/Core/Helpers/Log.class.php +++ b/core/lib/Core/Helpers/Log.class.php @@ -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); diff --git a/index.php b/index.php index 0194c9b..57e6db8 100644 --- a/index.php +++ b/index.php @@ -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);