. */ namespace Doctrine\DBAL\Logging; /** * Chains multiple SQLLogger * * * @link www.doctrine-project.org * @since 2.2 * @author Christophe Coevoet */ class LoggerChain implements SQLLogger { private $loggers = array(); /** * Adds a logger in the chain * * @param SQLLogger $logger */ public function addLogger(SQLLogger $logger) { $this->loggers[] = $logger; } /** * {@inheritdoc} */ public function startQuery($sql, array $params = null, array $types = null) { foreach ($this->loggers as $logger) { $logger->startQuery($sql, $params, $types); } } /** * {@inheritdoc} */ public function stopQuery() { foreach ($this->loggers as $logger) { $logger->stopQuery(); } } }