includes/Admin/Logger.php
public function addProfile($duration, $function, $statement, array $bind_values = array() ) {
        parent::addProfile($duration, $function, $statement, $bind_values);

        if($function == 'connect') {
            $this->log( sprintf('SQL: CONNECT (%s s)', number_format($duration, 5)) );
            return;
        }

        // If we are emulating prepare, don't log 'prepare' statement, as they are not actual queries sent to the server
        // See YDB::get_queries() for details
        if ($this->ydb->get_emulate_state() && $function !== 'prepare') {
            $this->log( sprintf('SQL: %s (%s s)', $this->pretty_format($statement, $bind_values), number_format($duration, 5) ) );
        }
    }
public function addProfile($duration, $function, $statement, array $bind_values = array() ) {
        parent::addProfile($duration, $function, $statement, $bind_values);

        if($function == 'connect') {
            $this->log( sprintf('SQL: CONNECT (%s s)', number_format($duration, 5)) );
            return;
        }

        // If we are emulating prepare, don't log 'prepare' statement, as they are not actual queries sent to the server
        // See YDB::get_queries() for details
        if ($this->ydb->get_emulate_state() && $function !== 'prepare') {
            $this->log( sprintf('SQL: %s (%s s)', $this->pretty_format($statement, $bind_values), number_format($duration, 5) ) );
        }
    }
Extends \Aura\Sql\Profiler::addProfile() to log queries in our YOURLS logger

@since  1.7.3
@param  float  $duration     The query duration.
@param  string $function     The PDO method that made the entry.
@param  string $statement    The SQL query statement.
@param  array  $bind_values  The values bound to the statement.
@return void