Esempio n. 1
0
 public function __destruct()
 {
     if ($this->_logger && $this->_profiler) {
         $this->_logger->log(sprintf('Total SQL execution time (%d queries): %.4f sec.', $this->_profiler->getNumberTotalStatements(), round($this->_profiler->getTotalElapsedSeconds(), 4)), $this->_priority);
         $this->_logger->commit();
     }
 }
Esempio n. 2
0
 public function __destruct()
 {
     if (!is_array($this->_data)) {
         $this->_data = [];
     }
     if (!empty($this->_filterFields) && is_array($this->_filterFields)) {
         $this->_data = array_intersect_key($this->_data, array_flip($this->_filterFields));
     }
     ksort($this->_data);
     $now = new \DateTime();
     $this->_data = array_merge(['_id' => $this->getLogId() ?: uniqid('', true), '_timestamp' => $now->format('c'), '_date' => $now->format('Y-m-d H:i:s')], $this->_data);
     $this->_adapter->log($this->_data, $this->_adapter->getLogLevel());
 }