if( $this->mIgnoreErrors ) {
wfDebug("SQL ERROR (ignored): " . $error . "\n");
} else {
+ $sql1line = str_replace( "\n", "\\n", $sql );
+ wfLogDBError("$errno\t$error\t$sql1line\n");
wfDebug("SQL ERROR: " . $error . "\n");
if ( $wgCommandLineMode ) {
wfDebugDieBacktrace( "A database error has occurred\n" .
$wgDBsqlpassword = 'sqlpass';
$wgDBpassword = 'userpass';
$wgSqlLogFile = "{$wgUploadDirectory}/sqllog_mFhyRe6";
+$wgDBerrorLog = false; # File to log MySQL errors to
$wgDBminWordLen = 4;
$wgDBtransactions = false; # Set to true if using InnoDB tables
}
}
+# Log for database errors
+function wfLogDBError( $text ) {
+ global $wgDBerrorLog;
+ if ( $wgDBerrorLog ) {
+ $text = date("D M j G:i:s T Y") . "\t$text";
+ error_log( $text, 3, $wgDBerrorLog );
+ }
+}
+
function logProfilingData()
{
global $wgRequestTime, $wgDebugLogFile;