From: Hypolite Petovan Date: Thu, 9 Jul 2020 19:03:48 +0000 (-0400) Subject: Move logged in logging where it makes sense in include/api X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=04c95a5045136cb18d09f0ae6f9cb46975dace13;p=friendica.git Move logged in logging where it makes sense in include/api --- diff --git a/include/api.php b/include/api.php index 85a34d2753..53d00b27de 100644 --- a/include/api.php +++ b/include/api.php @@ -335,16 +335,16 @@ function api_call(App $a, App\Arguments $args = null) if (!empty($info['auth']) && api_user() === false) { api_login($a); + Logger::info(API_LOG_PREFIX . 'username {username}', ['module' => 'api', 'action' => 'call', 'username' => $a->user['username']]); } - Logger::info(API_LOG_PREFIX . 'username {username}', ['module' => 'api', 'action' => 'call', 'username' => $a->user['username']]); Logger::debug(API_LOG_PREFIX . 'parameters', ['module' => 'api', 'action' => 'call', 'parameters' => $_REQUEST]); $stamp = microtime(true); $return = call_user_func($info['func'], $type); $duration = floatval(microtime(true) - $stamp); - Logger::info(API_LOG_PREFIX . 'username {username}', ['module' => 'api', 'action' => 'call', 'username' => $a->user['username'], 'duration' => round($duration, 2)]); + Logger::info(API_LOG_PREFIX . 'duration {duration}', ['module' => 'api', 'action' => 'call', 'duration' => round($duration, 2)]); DI::profiler()->saveLog(DI::logger(), API_LOG_PREFIX . 'performance');