예제 #1
0
 /**
  * Logs a response
  *
  * @param Response $response
  */
 protected function logResponse(Response $response)
 {
     if ($response instanceof RedirectResponse) {
         $this->logger->info('< ' . $response->getStatusCode() . ' ' . $response->getTargetUrl());
     } else {
         $this->logger->info('< ' . $response->getStatusCode());
     }
 }
 /**
  * Logs a response.
  *
  * @param Response $response
  */
 protected function logResponse(Response $response)
 {
     $response->headers->set('trace-token', TracingRequest::getInstance()->getTraceId());
     if ($response instanceof RedirectResponse) {
         $this->logger->info('< ' . $response->getStatusCode() . ' ' . $response->getTargetUrl());
     } else {
         $this->logger->info('HTTP response: ' . $response->getStatusCode() . ' #TRACE#{"event":"response.send"}');
     }
 }
예제 #3
0
 /**
  * @param \Symfony\Component\HttpFoundation\Response $response
  *
  * @return void
  */
 protected function logResponse(Response $response)
 {
     if ($response instanceof RedirectResponse) {
         $message = sprintf('%s Response %s [%s], target URL %s', $this->getSapi(), APPLICATION, $response->getStatusCode(), $response->getTargetUrl());
     } else {
         $message = sprintf('%s Response %s [%s]', $this->getSapi(), APPLICATION, $response->getStatusCode());
     }
     $this->logger->info($message, ['response' => $response]);
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     if ($response instanceof RedirectResponse) {
         $this->data['redirect'] = true;
         $this->data['url'] = $response->getTargetUrl();
         if ($this->controllers->contains($request)) {
             $this->data['route'] = $this->guessRoute($request, $this->controllers[$request]);
         }
     }
 }
예제 #5
0
 /**
  * {@inheritdoc}
  */
 public function collect(Request $request, Response $response, \Exception $exception = null)
 {
     if ($response instanceof RedirectResponse) {
         $this->data['redirect'] = true;
         $this->data['url'] = $response->getTargetUrl();
         if ($this->controllers->contains($request)) {
             $controller = $this->controllers[$request];
             if (is_array($controller)) {
                 $controller = $controller[0];
             }
             if ($controller instanceof RedirectController) {
                 $this->data['route'] = $request->attributes->get('_route', 'n/a');
             }
         }
     }
 }
예제 #6
0
 /**
  * Logs a response.
  *
  * @param Response $response
  */
 protected function logResponse(Response $response)
 {
     $message = '< ' . $response->getStatusCode();
     if ($response instanceof RedirectResponse) {
         $message .= ' ' . $response->getTargetUrl();
     }
     $this->logger->log(LogLevel::DEBUG, $message);
 }