Adding more info in error logs

skala
Julio Montoya 13 years ago
parent e5d2ca4991
commit f6365e051b
  1. 15
      main/inc/lib/database.lib.php
  2. 4
      main/inc/lib/database.mysqli.lib.php

@ -804,9 +804,12 @@ class Database {
if (isset(self::$log_queries) && self::$log_queries) { if (isset(self::$log_queries) && self::$log_queries) {
error_log("---------------- SQL error ---------------- "); error_log("---------------- SQL error ---------------- ");
error_log($query); error_log($query);
$info = 'FILE: ' .(empty($file) ? ' unknown ' : $file);
error_log($info); error_log('error #'.self::errno($connection));
$info = 'LINE: '.(empty($line) ? ' unknown ' : $line); error_log('error: '.self::error($connection));
$info = 'FILE: ' .(empty($file) ? ' unknown ' : $file);
$info .= ' +'.(empty($line) ? ' unknown ' : $line);
error_log($info); error_log($info);
if (empty($type)) { if (empty($type)) {
@ -816,10 +819,8 @@ class Database {
} }
} else { } else {
if (!empty($class) && !empty($function)) { if (!empty($class) && !empty($function)) {
$info = 'CLASS: ' . $class; $info = 'CLASS: ' . $class.' METHOD: '.$function;
error_log($info); error_log($info);
$info = 'METHOD: ' . $function;
error_log($info);
} }
} }
error_log("---------------- end ----------------"); error_log("---------------- end ----------------");

@ -714,6 +714,10 @@ class Database {
if (isset(self::$log_queries) && self::$log_queries) { if (isset(self::$log_queries) && self::$log_queries) {
error_log("---------------- SQL error ---------------- "); error_log("---------------- SQL error ---------------- ");
error_log($query); error_log($query);
error_log('error #'.self::errno($connection));
error_log('error: '.self::error($connection));
$info = 'FILE: ' .(empty($file) ? ' unknown ' : $file); $info = 'FILE: ' .(empty($file) ? ' unknown ' : $file);
error_log($info); error_log($info);
$info = 'LINE: '.(empty($line) ? ' unknown ' : $line); $info = 'LINE: '.(empty($line) ? ' unknown ' : $line);

Loading…
Cancel
Save