博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
AOP如何在业务结束时,根据参入参数和返回结果添加日志
阅读量:7255 次
发布时间:2019-06-29

本文共 872 字,大约阅读时间需要 2 分钟。

IMethodReturn retvalue = getNext()(input, getNext);            if (retvalue.Exception != null)            {                System.IO.File.AppendAllText("a.txt", retvalue.Exception.ToString());                retvalue.Exception = null;            }            if (retvalue != null)            {                var dll = Assembly.Load("AopIntercept");                Type tx = dll.GetType("AopIntercept."+input.Target.ToString().Substring(input.Target.ToString().LastIndexOf(".") + 1) + "Log");                MethodInfo mf = tx.GetMethod("Log");                List list = new List();                 list.Add(retvalue.ReturnValue);                 foreach (var item in input.Inputs)                 {                     list.Add(item);                 }                               mf.Invoke(null, list.ToArray());                          }            return retvalue;

 

转载地址:http://vckdm.baihongyu.com/

你可能感兴趣的文章
找到当前mysql group replication 环境的primary结点
查看>>
Fibonacci
查看>>
12.4.1 压缩索引
查看>>
springmvc图片上传(兼容ie8以上,实时预览)
查看>>
联想G510安装win7系统
查看>>
@P0或@P1附近有语法错误
查看>>
rpm 与压缩解压缩
查看>>
CSS扩展技术-less
查看>>
组合数学的卡特兰数 TOJ 3551: Game of Connections
查看>>
易宝典文章——用ISA 2006标准版发布Exchange 2010的OWA系列之外网客户端
查看>>
SCCM 2012系列4 配置SCCM2012 Endpoint Protection上
查看>>
分享做老师的幸福
查看>>
动软发布微信营销服务系统,微信商城系统!
查看>>
艺术是什么?不懂很难泡到妞!
查看>>
Open-E DSS V7 应用系列之三 Web管理简介
查看>>
phpunit 单元测试案例--签到任务
查看>>
python与shell校验IP地址合法性
查看>>
大话测试之BT思维
查看>>
利用Traefik+Docker构建可弹性扩展的微服务或服务集群
查看>>
记忆碎片 - 2015.09.11
查看>>