Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function save(LogInterface $log, $andFlush = true)
 {
     if (!$log instanceof $this->class) {
         throw new InvalidArgumentException('1st argument must be an instanceof ' . $this->getClass());
     }
     $extra = $log->getExtra();
     if (is_array($extra) && isset($extra['job_ticket'])) {
         /** @var \Abc\Bundle\JobBundle\Entity\Log $log */
         $log->setJobTicket($extra['job_ticket']);
         unset($extra['job_ticket']);
         $log->setExtra($extra);
     }
     parent::save($log, $andFlush);
 }
Beispiel #2
0
 /**
  * @param LogInterface $log
  * @param              $record
  */
 protected function populateLog(LogInterface $log, $record)
 {
     $log->setChannel($record['channel']);
     $log->setLevel($record['level']);
     $log->setLevelName($record['level_name']);
     $log->setMessage($record['message']);
     $log->setDatetime($record['datetime']);
     $log->setContext($record['context']);
     $log->setExtra($record['extra']);
 }