class RequestLogger in Search API Elasticsearch 8
Class QueryLogger @package Drupal\search_api_elasticsearch\Logger
Hierarchy
- class \Drupal\search_api_elasticsearch\Logger\RequestLogger implements \Psr\Log\LoggerInterface uses RfcLoggerTrait
Expanded class hierarchy of RequestLogger
1 file declares its use of RequestLogger
- Client.php in src/
Elastica/ Client.php
File
- src/
Logger/ RequestLogger.php, line 12
Namespace
Drupal\search_api_elasticsearch\LoggerView source
class RequestLogger implements LoggerInterface {
use RfcLoggerTrait;
/**
* @param LoggerInterface $logger
* @param bool $debug
*/
public function __construct(LoggerInterface $logger = null, $debug = false) {
$this->logger = $logger;
$this->debug = $debug;
}
/**
* @param $path
* @param $method
* @param $data
* @param array $connection
* @param array $query
*/
public function logQuery($path, $method, $data, $connection = array(), $query = array()) {
if ($this->debug) {
$this->queries[] = array(
'path' => $path,
'method' => $method,
'data' => $data,
'connection' => $connection,
'queryString' => $query,
);
}
if ($this->logger !== null) {
$message = sprintf("%s (%s)", $path, $method);
$this->logger
->info($message, (array) $data);
}
}
/**
* {@inheritdoc}
*/
public function log($level, $message, array $context = array()) {
return $this->logger
->log($level, $message, $context);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
RequestLogger:: |
public | function |
Overrides RfcLoggerTrait:: |
|
RequestLogger:: |
public | function | ||
RequestLogger:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function | ||
RfcLoggerTrait:: |
public | function |