封装一个基于NLog+NLog.Mongo的日志记录工具类LogUtil,代码比较简单,主要是把MongoTarget的配置.FileTarget的配置集成到类中,同时利用缓存依赖来判断是否需要重新创建Logger类,完整代码如下: using NLog; using NLog.Config; using NLog.Mongo; using NLog.Targets; using System; using System.Collections.Generic; using System.IO;
var rowData = ajaxgrid.getSelectedRow(); var quality = rowData["quality"]; var rowIndex = rowData["rowIndex"]; var record = ajaxgrid.getRecord(rowIndex); if(quality==111){ record.set("source", "-3"); }