mirror of
https://github.com/rsyslog/loganalyzer.git
synced 2025-09-25 18:59:12 +02:00
Added support for debug output in Cleanup routine of mysql and pdo logstreams.
This commit is contained in:
parent
542c988556
commit
ebe93ace8c
@ -657,7 +657,6 @@ class LogStreamDB extends LogStream {
|
||||
// Set default rowcount
|
||||
$rowcount = null;
|
||||
|
||||
|
||||
// Perform if Connection is true!
|
||||
if ( $this->_dbhandle != null )
|
||||
{
|
||||
@ -678,6 +677,11 @@ class LogStreamDB extends LogStream {
|
||||
// Free result not needed here!
|
||||
//mysql_free_result ($myQuery);
|
||||
}
|
||||
else
|
||||
{
|
||||
// error occured, output DEBUG message
|
||||
$this->PrintDebugError("CleanupLogdataByDate failed with SQL Statement ' " . $szSql . " '");
|
||||
}
|
||||
}
|
||||
|
||||
//return affected rows
|
||||
@ -1212,21 +1216,15 @@ class LogStreamDB extends LogStream {
|
||||
*/
|
||||
private function PrintDebugError($szErrorMsg)
|
||||
{
|
||||
if ( GetConfigSetting("MiscShowDebugMsg", 0, CFGLEVEL_USER) == 1 )
|
||||
{
|
||||
$errdesc = mysql_error();
|
||||
$errno = mysql_errno();
|
||||
$errdesc = mysql_error();
|
||||
$errno = mysql_errno();
|
||||
|
||||
$errormsg="Database error: $szErrorMsg <br>";
|
||||
$errormsg.="mysql error: $errdesc <br>";
|
||||
$errormsg.="mysql error number: $errno <br>";
|
||||
$errormsg.="Date: ".date("d.m.Y @ H:i"). "<br>";
|
||||
$errormsg.="Script: ".getenv("REQUEST_URI"). "<br>";
|
||||
$errormsg.="Referer: ".getenv("HTTP_REFERER"). "<br>";
|
||||
|
||||
//Output!
|
||||
OutputDebugMessage("LogStreamDB|CreateMainSQLQuery: $errormsg", DEBUG_ERROR);
|
||||
}
|
||||
$errormsg="$szErrorMsg <br>";
|
||||
$errormsg.="Detail error: $errdesc <br>";
|
||||
$errormsg.="Error Code: $errno <br>";
|
||||
|
||||
//Output!
|
||||
OutputDebugMessage("LogStreamDB|PrintDebugError: $errormsg", DEBUG_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -669,6 +669,11 @@ class LogStreamPDO extends LogStream {
|
||||
// Free query now
|
||||
$myQuery->closeCursor();
|
||||
}
|
||||
else
|
||||
{
|
||||
// error occured, output DEBUG message
|
||||
$this->PrintDebugError("CleanupLogdataByDate failed with SQL Statement ' " . $szSql . " '");
|
||||
}
|
||||
}
|
||||
|
||||
//return affected rows
|
||||
@ -1182,20 +1187,15 @@ class LogStreamPDO extends LogStream {
|
||||
*/
|
||||
private function PrintDebugError($szErrorMsg)
|
||||
{
|
||||
if ( GetConfigSetting("MiscShowDebugMsg", 0, CFGLEVEL_USER) == 1 )
|
||||
{
|
||||
$errdesc = $this->_dbhandle == null ? "" : implode( ";", $this->_dbhandle->errorInfo() );
|
||||
$errno = $this->_dbhandle == null ? "" : $this->_dbhandle->errorCode();
|
||||
$errdesc = $this->_dbhandle == null ? "" : implode( ";", $this->_dbhandle->errorInfo() );
|
||||
$errno = $this->_dbhandle == null ? "" : $this->_dbhandle->errorCode();
|
||||
|
||||
$errormsg ="<font color='red'>Error: " . $szErrorMsg . "</font></H3><br>";
|
||||
$errormsg.="<B>Errordetails:</B><br>";
|
||||
$errormsg.="Detail Error: $errdesc <br>";
|
||||
$errormsg.="Error Code: $errno <br>";
|
||||
$errormsg.="Date: ".date("d.m.Y @ H:i"). "<br>";
|
||||
|
||||
//Output!
|
||||
OutputDebugMessage("LogStreamPDO|CreateMainSQLQuery: $errormsg", DEBUG_ERROR);
|
||||
}
|
||||
$errormsg="$szErrorMsg <br>";
|
||||
$errormsg.="Detail error: $errdesc <br>";
|
||||
$errormsg.="Error Code: $errno <br>";
|
||||
|
||||
//Output!
|
||||
OutputDebugMessage("LogStreamPDO|PrintDebugError: $errormsg", DEBUG_ERROR);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user