コード例 #1
0
 /**
  * @param PostResponseEvent $event
  */
 public function onKernelTerminate(PostResponseEvent $event)
 {
     $stopwatchEvent = $this->stopwatch->stop('request');
     $duration = $stopwatchEvent->getDuration();
     $attributes = $this->flattenAttributes($event->getRequest()->attributes->all());
     $data = ['service' => 'request.duration', 'metrics' => $duration];
     $this->logger->log($data, $attributes);
 }
 public function flush()
 {
     foreach ($this->logCount as $level => $count) {
         $this->riemannLogger->log(['service' => 'logs.count', 'metrics' => $count], ['level' => $level]);
     }
 }