Fix issue with logger not having logQuery method

This commit is contained in:
Tim Nagel 2013-12-10 21:25:38 +11:00
commit 70e6cb2e7e

View file

@ -4,6 +4,7 @@ namespace FOS\ElasticaBundle;
use Elastica\Client as ElasticaClient;
use Elastica\Request;
use FOS\ElasticaBundle\Logger\ElasticaLogger;
/**
* @author Gordon Franke <info@nevalon.de>
@ -15,7 +16,7 @@ class Client extends ElasticaClient
$start = microtime(true);
$response = parent::request($path, $method, $data, $query);
if (null !== $this->_logger) {
if (null !== $this->_logger and $this->_logger instanceof ElasticaLogger) {
$time = microtime(true) - $start;
$connection = $this->getLastRequest()->getConnection();