Skip to content
Permalink
Browse files

Added more verbose logging of request.

  • Loading branch information...
bbankowski committed Sep 3, 2019
1 parent c932c1b commit e1d3d0109a1dcad623d20914f16c98bcdb180cb7
Showing with 19 additions and 2 deletions.
  1. +19 −2 src/Ouzo/Core/Middleware/Interceptor/LogRequest.php
@@ -8,20 +8,37 @@
use Ouzo\Logger\Logger;
use Ouzo\Request\RequestContext;
use Ouzo\Uri;
use Ouzo\Uri\PathProvider;
use Ouzo\Uri\PathProviderInterface;
use Ouzo\Utilities\Chain\Chain;
use Ouzo\Utilities\Chain\Interceptor;
class LogRequest implements Interceptor
{
private $pathProvider;
/**
* @Inject
*/
public function __construct(PathProviderInterface $pathProvider)
{
$this->pathProvider = $pathProvider;
}
/**
* @param RequestContext $requestContext
* @param Chain $next
* @return Chain
*/
public function handle($requestContext, Chain $next)
{
Logger::getLogger(__CLASS__)
->info('[Request:/%s/%s]', [$requestContext->getCurrentController(), $requestContext->getCurrentAction()]);
Logger::getLogger(__CLASS__)->info('[Action: %s#%s] [Request: %s %s]', [
$requestContext->getCurrentController(),
$requestContext->getCurrentAction(),
Uri::getRequestType(),
$this->pathProvider->getPath()
]);
return $next->proceed($requestContext);
}

0 comments on commit e1d3d01

Please sign in to comment.
You can’t perform that action at this time.