/**
  * Sets the job ticket in $record['extra']['job_ticket']
  *
  * {@inheritdoc}
  */
 protected function write(array $record)
 {
     $log = $this->manager->create();
     $record['extra']['job_ticket'] = $this->job->getTicket();
     $this->populateLog($log, $record);
     $this->manager->save($log);
 }
 public function deleteByJob(JobInterface $job)
 {
     $path = $this->buildPath($job->getTicket());
     $filesystem = new Filesystem();
     if ($filesystem->exists($path)) {
         $filesystem->remove($path);
     }
 }
Example #3
0
 /**
  * Get lock name for job object
  *
  * @param JobInterface $job
  * @return string
  */
 private function getLockName(JobInterface $job)
 {
     return self::JOB_LOCK_PREFIX . $job->getTicket();
 }
 /**
  * {@inheritdoc}
  */
 public function createHandler(JobInterface $job, $level, $bubble)
 {
     $handler = new StreamHandler($this->buildPath($job->getTicket()), $level, $bubble);
     return $this->initHandler($handler);
 }
Example #5
0
 /**
  * {@inheritdoc}
  */
 public function deleteByJob(BaseJobInterface $job)
 {
     return $this->deleteLogs($this->findBy(['jobTicket' => $job->getTicket()]));
 }
Example #6
0
 /**
  * @param JobInterface $job
  * @return string The channel name
  */
 protected function buildChannel(JobInterface $job)
 {
     return $job->getTicket();
 }