public function logQuery($path, $method, $data, $queryTime, $connection = [], $query = [], $engineTime = 0, $itemCount = 0)
    {
        $executionMS = $queryTime * 1000;

        if ($this->debug) {
            $e = new \Exception();
            if (is_string($data)) {
                $jsonStrings = explode("\n", $data);
                $data = [];
                foreach ($jsonStrings as $json) {
                    if ($json != '') {
                        $data[] = json_decode($json, true);
                    }
                }
            } else {
                $data = [$data];
            }

            $this->queries[] = [
                'path' => $path,
                'method' => $method,
                'data' => $data,
                'executionMS' => $executionMS,
                'engineMS' => $engineTime,
                'connection' => $connection,
                'queryString' => $query,
                'itemCount' => $itemCount,
                'backtrace' => $e->getTraceAsString(),
            ];
        }

        if (null !== $this->logger) {
            $message = sprintf('%s (%s) %0.2f ms', $path, $method, $executionMS);
            $this->logger->info($message, (array) $data);
        }
    }
public function logQuery($path, $method, $data, $queryTime, $connection = [], $query = [], $engineTime = 0, $itemCount = 0)
    {
        $executionMS = $queryTime * 1000;

        if ($this->debug) {
            $e = new \Exception();
            if (is_string($data)) {
                $jsonStrings = explode("\n", $data);
                $data = [];
                foreach ($jsonStrings as $json) {
                    if ($json != '') {
                        $data[] = json_decode($json, true);
                    }
                }
            } else {
                $data = [$data];
            }

            $this->queries[] = [
                'path' => $path,
                'method' => $method,
                'data' => $data,
                'executionMS' => $executionMS,
                'engineMS' => $engineTime,
                'connection' => $connection,
                'queryString' => $query,
                'itemCount' => $itemCount,
                'backtrace' => $e->getTraceAsString(),
            ];
        }

        if (null !== $this->logger) {
            $message = sprintf('%s (%s) %0.2f ms', $path, $method, $executionMS);
            $this->logger->info($message, (array) $data);
        }
    }
public function logQuery ( $ path , $ method , $ data , $ queryTime , $ connection = [ ] , $ query = [ ] , $ engineTime = 0 , $ itemCount = 0 ) { $ executionMS = $ queryTime * 1000 ; if ( $ this -> debug ) { $ e = new \ Exception ( ) ; if ( is_string ( $ data ) ) { $ jsonStrings = explode ( "\n" , $ data ) ; $ data = [ ] ; foreach ( $ jsonStrings as $ json ) { if ( $ json != '' ) { $ data [ ] = json_decode ( $ json , true ) ; } } } else { $ data = [ $ data ] ; } $ this -> queries [ ] = [ 'path' => $ path , 'method' => $ method , 'data' => $ data , 'executionMS' => $ executionMS , 'engineMS' => $ engineTime , 'connection' => $ connection , 'queryString' => $ query , 'itemCount' => $ itemCount , 'backtrace' => $ e -> getTraceAsString ( ) , ] ; } if ( null !== $ this -> logger ) { $ message = sprintf ( '%s (%s) %0.2f ms' , $ path , $ method , $ executionMS ) ; $ this -> logger -> info ( $ message , ( array ) $ data ) ; } }
Logs a query.

@param string $path       Path to call
@param string $method     Rest method to use (GET, POST, DELETE, PUT)
@param array|string $data Arguments
@param float  $queryTime  Execution time (in seconds)
@param array  $connection Host, port, transport, and headers of the query
@param array  $query      Arguments
@param int    $engineTime
@param int    $itemCount
Logs a query .