/** * 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"}'); } }
/** * @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]); }
/** * {@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]); } } }
/** * {@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'); } } } }
/** * 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); }