cakephp / elastic-search

Elastic search datasource for CakePHP
Other
88 stars 53 forks source link

Client ignores "log=>true" in config and $logQueries field is never set #91

Closed Antoniossss closed 8 years ago

Antoniossss commented 8 years ago

There is not place where Cake\ElasticSearch\Datasource\Connection#logQueries is set to the value of $config['log'] causing no way to enable request logging.One way would be to add proper conditional in the contructor as it is done for 'name'

    public function __construct(array $config = [], $callback = null)
    {
        $config += ['index' => '_all'];
        if (isset($config['name'])) {
            $this->configName = $config['name'];
        }
        parent::__construct($config, $callback);
    }
markstory commented 8 years ago

Pull request up now.