diff --git a/app/Jobs/WowaJob.php b/app/Jobs/WowaJob.php index cc9c59e6edcdda26b6312eac4839db8e95cdf556..f45925c8d314a9bfb0aff71c03c387b4b5d67e53 100644 --- a/app/Jobs/WowaJob.php +++ b/app/Jobs/WowaJob.php @@ -101,6 +101,8 @@ class WowaJob implements ShouldQueue $trainer = new Trainer($training_prameters, new SolutionDistance(count($this->evidences[0]))); $this->wowa->status = Wowa::STATE_RUNNING; $this->wowa->save(); + $processor->setTrainingBooleanTrue(); + $logg->pushProcessor($processor); try { $solution = $trainer->run($this->evidences, $this->is_true_alert); } catch (\Exception $e) { diff --git a/app/Logging/LogProcessor.php b/app/Logging/LogProcessor.php index 8066ce2ac0724e8ee6abf62678faaae6f5fefcbc..180644da498e4b00532f2013cef518ffcb45e572 100644 --- a/app/Logging/LogProcessor.php +++ b/app/Logging/LogProcessor.php @@ -7,11 +7,13 @@ class LogProcessor { protected $job_id; + protected $training_bool = false; public function __invoke(array $record): array { $record['extra'] = [ 'user_id' => auth()->user() ? auth()->user()->id : null, - 'job_id' => $this->job_id + 'job_id' => $this->job_id, + 'training' => $this->training_bool ]; return $record; } @@ -20,4 +22,9 @@ class LogProcessor { $this->job_id = $job_id; } + + public function setTrainingBooleanTrue() + { + $this->training_bool = true; + } }