mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Add logs
This commit is contained in:
1 parent
f482d96225
commit
c2bdbbe1ec
10 files changed
+80
-16
No files matched your search
@@ -38,14 +38,19 @@ use Utopia\Validator\Range;
|
||||
use Utopia\Validator\Text;
|
||||
use Utopia\Validator\URL;
|
||||
use Utopia\Validator\WhiteList;
|
||||
use Utopia\Logger\Log;
|
||||
|
||||
App::init()
|
||||
->groups(['projects'])
|
||||
->inject('project')
|
||||
->action(function (Document $project) {
|
||||
->inject('startTime')
|
||||
->inject('log')
|
||||
->action(function (Document $project, float $startTime, Log $log) {
|
||||
$log->addExtra('projectInitStart', \strval(\microtime(true)));
|
||||
if ($project->getId() !== 'console') {
|
||||
throw new Exception(Exception::GENERAL_ACCESS_FORBIDDEN);
|
||||
}
|
||||
$log->addExtra('projectInitEnd', \strval(\microtime(true)));
|
||||
});
|
||||
|
||||
App::post('/v1/projects')
|
||||
|
||||
Reference in new issue
Block a user