TeeLogger.php in Backup and Migrate 5.0.x
File
src/Core/Service/TeeLogger.php
View source
<?php
namespace Drupal\backup_migrate\Core\Service;
use Psr\Log\AbstractLogger;
use Psr\Log\LoggerInterface;
class TeeLogger extends AbstractLogger {
protected $loggers;
public function __construct(array $loggers) {
$this
->setLoggers($loggers);
}
public function log($level, $message, array $context = []) {
foreach ($this
->getLoggers() as $logger) {
$logger
->log($level, $message, $context);
}
}
public function getLoggers() {
return $this->loggers;
}
public function setLoggers(array $loggers) {
$this->loggers = $loggers;
}
public function addLogger(LoggerInterface $logger) {
$this->loggers[] = $logger;
}
}
Classes
Name |
Description |
TeeLogger |
@package Drupal\backup_migrate\Core\Tests\Service |