1 log.inc public DatabaseLog::log(DatabaseStatementInterface $statement, $args, $time)

Log a query to all active logging keys.

Parameters

DatabaseStatementInterface $statement: The prepared statement object to log.

array $args: The arguments passed to the statement object.

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

File

core/includes/database/log.inc, line 116
Logging classes for the database layer.

Class

DatabaseLog
Database query logger.

Code

public function log(DatabaseStatementInterface $statement, $args, $time) { // phpcs:ignore -- No type hint on $args, add in 2.x.
  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,
    );
  }
}