I want to do something logging like this
$this->logger->info($request);
in some of the functions of routes.php i.e.
$app->add(function ($request, $handler) {
$response = $handler->handle($request);
$this-logger->info($request);
...
But I’m getting server error:
"description": "ERROR: Undefined property: DI\\Container::$logger on line 26 in file \/var\/www\/html\/invAdminAPI\/app\/routes.php."
How to do this?