mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
feature: Print mysql errors in debug output. (#8414)
* Print mysql errors in debug output. * drop debug flag * Fix sensor order...
This commit is contained in:
committed by
Neil Lathwood
parent
2f25d11747
commit
a9e31dca0e
@ -117,7 +117,9 @@ function dbQuery($sql, $parameters = array())
|
||||
$mysql_error = mysqli_error($database_link);
|
||||
if (isset($config['mysql_log_level']) && ((in_array($config['mysql_log_level'], array('INFO', 'ERROR')) && !preg_match('/Duplicate entry/', $mysql_error)) || in_array($config['mysql_log_level'], array('DEBUG')))) {
|
||||
if (!empty($mysql_error)) {
|
||||
logfile(date($config['dateformat']['compact']) . " MySQL Error: $mysql_error ($fullSql)");
|
||||
$error_msg = "MySQL Error: $mysql_error ($fullSql)";
|
||||
c_echo("%R$error_msg%n\n");
|
||||
logfile(date($config['dateformat']['compact']) . ' ' . $error_msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user