Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions src/Executor/Logger/AbstractLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
namespace Elements\Bundle\ProcessManagerBundle\Executor\Logger;

use Elements\Bundle\ProcessManagerBundle\Model\MonitoringItem;
use Monolog\Handler\StreamHandler;
use Pimcore\Bundle\ApplicationLoggerBundle\Handler\ApplicationLoggerDb;
use Monolog\Handler\HandlerInterface;

abstract class AbstractLogger
{
Expand Down Expand Up @@ -93,9 +92,16 @@ public function setConfig(array $config)
abstract public function getGridLoggerHtml(MonitoringItem $monitoringItem, array $actionData): string;

/**
* Returns the log writer which is registered on the monitoring item logger.
*
* Any Monolog handler is accepted here, because the return value is passed to
* ApplicationLogger::addWriter(), which handles every HandlerInterface implementation.
* Restricting this to StreamHandler would rule out handlers that do not write to a
* stream, for example the AsyncAws CloudWatch handler.
*
* @param array<mixed> $config
* @param MonitoringItem $monitoringItem
*
*/
abstract public function createStreamHandler(array $config, MonitoringItem $monitoringItem): StreamHandler | ApplicationLoggerDb | null;
abstract public function createStreamHandler(array $config, MonitoringItem $monitoringItem): ?HandlerInterface;
}