MYSQL执行操作日志记录到文件

来源:互联网 发布:布衣柜淘宝购买 编辑:程序博客网 时间:2024/04/19 14:34
 /****记录ExecuteNoneQuery的日志****/$mysql_error_ExecuteNoneQuery = dirname(__FILE__).'/../mysql_error_ExecuteNoneQuery.inc';$myfp_ExecuteNoneQuery = @fopen($mysql_error_ExecuteNoneQuery , 'a');@fwrite($myfp_ExecuteNoneQuery,"ExecuteNoneQuery执行:\r\n/*\r\n{$sql}"."**********".date('Y-m-d H:i:s')."\r\n*/\r\n\r\n");@fclose($myfp_ExecuteNoneQuery);/****记录ExecuteNoneQuery的日志****/

Line:212-217

/****记录Execute的日志****/$mysql_error_Execute = dirname(__FILE__).'/../mysql_error_Execute.inc';$myfp_Execute = @fopen($mysql_error_Execute, 'a');@fwrite($myfp_Execute,"Execute执行:\r\n/*\r\n{$sql}"."**********".date('Y-m-d H:i:s')."\r\n*/\r\n\r\n");@fclose($myfp_Execute);/****记录Execute的日志****/

Line:314-319

/****记录GetOne的日志****/$mysql_error_GetOne = dirname(__FILE__).'/../mysql_error_GetOne.inc';$myfp_GetOne = @fopen($mysql_error_GetOne, 'a');@fwrite($myfp_GetOne,"GetOne执行:\r\n/*\r\n{$sql}"."**********".date('Y-m-d H:i:s')."\r\n*/\r\n\r\n");@fclose($myfp_GetOne);/****记录GetOne的日志****/

Line:365-370

/****记录GetAll的日志****/$mysql_error_GetAll = dirname(__FILE__).'/../mysql_error_GetAll.inc';$myfp_GetAll = @fopen($mysql_error_GetAll , 'a');@fwrite($myfp_GetAll,"GetAll执行:\r\n/*\r\n{$sql}"."**********".date('Y-m-d H:i:s')."\r\n*/\r\n\r\n");@fclose($myfp_GetAll);/****记录GetAll的日志****/

Line:424-429

/****记录SetQuery的日志****/$mysql_error_SetQuery = dirname(__FILE__).'/../mysql_error_SetQuery.inc';$myfp_SetQuery = @fopen($mysql_error_SetQuery , 'a');@fwrite($myfp_SetQuery,"SetQuery执行:\r\n/*\r\n{$sql}"."**********".date('Y-m-d H:i:s')."\r\n*/\r\n\r\n");@fclose($myfp_SetQuery);/****记录SetQuery的日志****/

Line:598-603

PS: DEDECMS之include/dedesql.class.php中追加


1 0
原创粉丝点击