Skip to content

Commit

Permalink
ACP-3963 Algolia Event-Based Features. (#11158)
Browse files Browse the repository at this point in the history
ACP-3963 Algolia Event-Based Features.
  • Loading branch information
vol4onok authored Nov 21, 2024
1 parent 4cbc9c9 commit 9f1f9cd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Monolog\Logger;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use Spryker\Shared\Log\LoggerTrait;
use Spryker\Zed\Kernel\Business\AbstractBusinessFactory;
use Spryker\Zed\MessageBroker\Business\Config\ConfigFormatterInterface;
use Spryker\Zed\MessageBroker\Business\Config\JsonToArrayConfigFormatter;
Expand Down Expand Up @@ -52,6 +53,8 @@
*/
class MessageBrokerBusinessFactory extends AbstractBusinessFactory
{
use LoggerTrait;

/**
* @var string
*/
Expand Down Expand Up @@ -331,6 +334,10 @@ public function createLogger(): LoggerInterface
return $this->createNullLogger();
}

if ($this->getConfig()->isDefaultApplicationLoggerUsed()) {
return $this->getLogger();
}

$logger = new Logger(static::LOGGER_NAME);
$logger->pushHandler(
$this->createStreamHandler(),
Expand All @@ -348,6 +355,8 @@ public function createNullLogger(): LoggerInterface
}

/**
* @deprecated Will be removed without replacement.
*
* @return \Monolog\Handler\HandlerInterface
*/
public function createStreamHandler(): HandlerInterface
Expand Down
17 changes: 17 additions & 0 deletions src/Spryker/Zed/MessageBroker/MessageBrokerConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,29 @@ public function isLoggingEnabled(): bool
return $this->get(MessageBrokerConstants::LOGGING_ENABLED, false);
}

/**
* Specification:
* - This configuration identifies whether default Spryker logger must be used instead of file logger.
*
* @api
*
* @deprecated Will be removed without replacement.
*
* @return bool
*/
public function isDefaultApplicationLoggerUsed(): bool
{
return false;
}

/**
* Specification:
* - This configuration defines log file path.
*
* @api
*
* @deprecated Will be removed without replacement.
*
* @return string
*/
public function getLogFilePath(): string
Expand Down

0 comments on commit 9f1f9cd

Please sign in to comment.