ソースを参照

Se chequea que exista el servicio de monolog

Guillermo Espinoza 7 年 前
コミット
c1b4a025c4
1 ファイル変更7 行追加4 行削除
  1. 7 4
      Services/TaskLoggerService.php

+ 7 - 4
Services/TaskLoggerService.php

@@ -46,10 +46,13 @@ class TaskLoggerService implements ConsumerInterface
             $filename = $this->createTaskLoggerCmdFile($taskloggerId, $content);
             $output = $this->runProcess($filename);
             
-            $this->serviceContainer->get('monolog.logger.devicelog')->info($output['output'], [
-                'deviceType' => $msgBody['entityClass'],
-                'deviceId' => $msgBody['entityId'],
-            ]);
+            $monologLoggerId = 'monolog.logger.devicelog';
+            if ($this->serviceContainer->has($monologLoggerId)) {
+                $this->serviceContainer->get($monologLoggerId)->info($output['output'], [
+                    'deviceType' => $msgBody['entityClass'],
+                    'deviceId' => $msgBody['entityId'],
+                ]);
+            }
             
             var_export($output);