From bd5298f12dbdb0a81a7d62cf3a330474ec454917 Mon Sep 17 00:00:00 2001 From: Daniel Hoffmann Date: Mon, 5 Aug 2024 13:04:42 +0200 Subject: [PATCH] [BUGFIX] Enable Logging in Command on foreign Resolves: https://projekte.in2code.de/issues/65670 --- .../Command/Foreign/RunTasksInQueueCommand.php | 11 +++++++++-- .../PostPublishTaskExecution/ForeignServices.php | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Classes/Component/PostPublishTaskExecution/Command/Foreign/RunTasksInQueueCommand.php b/Classes/Component/PostPublishTaskExecution/Command/Foreign/RunTasksInQueueCommand.php index c7dffdbf3..520bc03b3 100644 --- a/Classes/Component/PostPublishTaskExecution/Command/Foreign/RunTasksInQueueCommand.php +++ b/Classes/Component/PostPublishTaskExecution/Command/Foreign/RunTasksInQueueCommand.php @@ -32,7 +32,7 @@ use In2code\In2publishCore\Component\PostPublishTaskExecution\Domain\Model\Task\AbstractTask; use In2code\In2publishCore\Component\PostPublishTaskExecution\Domain\Repository\TaskRepositoryInjection; use In2code\In2publishCore\Service\Context\ContextServiceInjection; -use Psr\Log\LoggerAwareTrait; +use Psr\Log\LoggerInterface; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; @@ -50,10 +50,17 @@ class RunTasksInQueueCommand extends Command { use ContextServiceInjection; use TaskRepositoryInjection; - use LoggerAwareTrait; public const IDENTIFIER = 'in2publish_core:publishtasksrunner:runtasksinqueue'; + protected ?LoggerInterface $logger = null; + + public function __construct(LoggerInterface $logger) + { + $this->logger = $logger; + parent::__construct(); + } + public function isEnabled(): bool { return $this->contextService->isForeign(); diff --git a/Configuration/Component/PostPublishTaskExecution/ForeignServices.php b/Configuration/Component/PostPublishTaskExecution/ForeignServices.php index cdca0a5b7..e9eaca3b6 100644 --- a/Configuration/Component/PostPublishTaskExecution/ForeignServices.php +++ b/Configuration/Component/PostPublishTaskExecution/ForeignServices.php @@ -25,5 +25,6 @@ 'hidden' => true, 'schedulable' => false, ], - ); + ) + ->public(); };