class Log

Database query logger.

We log queries in a separate object rather than in the connection object because we want to be able to see all queries sent to a given database, not database target. If we logged the queries in each connection object we would not be able to track what queries went to which target.

Every connection has one and only one logging object on it for all targets and logging keys.

Hierarchy

  • class \Drupal\Core\Database\Log

Expanded class hierarchy of Log

File

drupal/core/lib/Drupal/Core/Database/Log.php, line 21
Definition of Drupal\Core\Database\Log

Namespace

Drupal\Core\Database
View source

Members

Namesort descending Modifiers Type Description Overrides
Log::$connectionKey protected property The connection key for which this object is logging.
Log::$queryLog protected property Cache of logged queries. This will only be used if the query logger is enabled.
Log::clear public function Empty the query log for the specified logging key.
Log::end public function Stop logging for the specified logging key.
Log::findCaller public function Determine the routine that called this query.
Log::get public function Retrieve the query log for the specified logging key so far.
Log::log public function Log a query to all active logging keys.
Log::start public function Begin logging queries to the specified connection and logging key.
Log::__construct public function Constructor.