mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Add logs
This commit is contained in:
1 parent
f482d96225
commit
c2bdbbe1ec
10 files changed
+80
-16
No files matched your search
@@ -55,6 +55,7 @@ use Utopia\Validator\Range;
|
||||
use Utopia\Validator\Text;
|
||||
use Utopia\Validator\URL;
|
||||
use Utopia\Validator\WhiteList;
|
||||
use Utopia\Logger\Log;
|
||||
|
||||
/**
|
||||
* * Create attribute of varying type
|
||||
@@ -387,12 +388,16 @@ App::init()
|
||||
->groups(['api', 'database'])
|
||||
->inject('request')
|
||||
->inject('dbForProject')
|
||||
->action(function (Request $request, Database $dbForProject) {
|
||||
->inject('startTime')
|
||||
->inject('log')
|
||||
->action(function (Request $request, Database $dbForProject, float $startTime, Log $log) {
|
||||
$log->addExtra('databaseInitStart', \strval(\microtime(true)));
|
||||
$timeout = \intval($request->getHeader('x-appwrite-timeout'));
|
||||
|
||||
if (!empty($timeout) && App::isDevelopment()) {
|
||||
$dbForProject->setTimeout($timeout);
|
||||
}
|
||||
$log->addExtra('databaseInitEnd', \strval(\microtime(true)));
|
||||
});
|
||||
|
||||
App::post('/v1/databases')
|
||||
|
||||
Reference in new issue
Block a user