mirror of
https://github.com/friendica/friendica
synced 2025-04-26 08:30:10 +00:00
Merge pull request #11530 from annando/logruntime
Configuration for logging added
This commit is contained in:
commit
7d958e8804
4 changed files with 18 additions and 4 deletions
|
@ -719,7 +719,7 @@ class App
|
|||
} catch (HTTPException $e) {
|
||||
(new ModuleHTTPException())->rawContent($e);
|
||||
}
|
||||
$page->logRuntime();
|
||||
$page->logRuntime($this->config);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -98,10 +98,16 @@ class Page implements ArrayAccess
|
|||
$this->method = $method;
|
||||
}
|
||||
|
||||
public function logRuntime()
|
||||
public function logRuntime(IManageConfigValues $config)
|
||||
{
|
||||
if (in_array($this->command, $config->get('system', 'runtime_ignore'))) {
|
||||
return;
|
||||
}
|
||||
|
||||
$runtime = number_format(microtime(true) - $this->timestamp, 3);
|
||||
Logger::debug('Runtime', ['method' => $this->method, 'command' => $this->command, 'runtime' => $runtime]);
|
||||
if ($runtime > $config->get('system', 'runtime_loglimit')) {
|
||||
Logger::debug('Runtime', ['method' => $this->method, 'command' => $this->command, 'runtime' => $runtime]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -369,7 +369,7 @@ class System
|
|||
*/
|
||||
public static function exit()
|
||||
{
|
||||
DI::page()->logRuntime();
|
||||
DI::page()->logRuntime(DI::config());
|
||||
exit();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue