//自定义字段写入NLog日志private void saveNLog(InvokeLogModel model){LogEventInfo ei = new LogEventInfo();ei.Properties["InvokeResult"] = model.InvokeResult;ei.Properties["RequestUrl"] = model.RequestUrl;ei.Properties["MethodName"] = model.MethodName;ei.Properties["InvokeUserName"] = model.InvokeUserName;ei.Properties["InputJson"] = model.InputJson;ei.Properties["OutputJson"] = model.OutputJson;ei.Properties["BeginTime"] = model.BeginTime;ei.Properties["EndTime"] = model.EndTime;//ei.Message = "my test log message";ei.Level = LogLevel.Info;nlogger.Log(ei);}//配置读取自定义字段INSERT INTO [LogInfo].[InterfaceBeInvokedLog]([LogLevel],[InvokeResult],[InvokeUserName],[RequestUrl],[MethodName],[InputJson],[OutputJson],[BeginTime],[EndTime])values (@LogLevel, @InvokeResult, @InvokeUserName, @RequestUrl, @MethodName, @InputJson, @OutputJson, @BeginTime, @EndTime);