Crud\Listener\ApiQueryLogListener::setupLogging PHP Method

setupLogging() public method

Setup logging for all connections
public setupLogging ( Cake\Event\Event $event ) : void
$event Cake\Event\Event Event
return void
    public function setupLogging(Event $event)
    {
        foreach ($this->_getSources() as $connectionName) {
            try {
                $this->_getSource($connectionName)->logQueries(true);
                $this->_getSource($connectionName)->logger(new QueryLogger());
            } catch (MissingDatasourceConfigException $e) {
                //Safe to ignore this :-)
            }
        }
    }