public function Log::log

public Log::log(StatementInterface $statement, $args, $time)

Log a query to all active logging keys.

Parameters

$statement: The prepared statement object to log.

$args: The arguments passed to the statement object.

$time: The time in milliseconds the query took to execute.

File

core/lib/Drupal/Core/Database/Log.php, line 112

Class

Log
Database query logger.

Namespace

Drupal\Core\Database

Code

public function log(StatementInterface $statement, $args, $time) {
  foreach (array_keys($this->queryLog) as $key) {
    $this->queryLog[$key][] = array(
      'query' => $statement->getQueryString(),
      'args' => $args,
      'target' => $statement->dbh->getTarget(),
      'caller' => $this->findCaller(),
      'time' => $time,
    );
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Database!Log.php/function/Log::log/8.1.x