在大型项目上实施日志系统的最佳方法是什么? [英] What't best way to implement logging system on a large project?

查看:102
本文介绍了在大型项目上实施日志系统的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我们的项目已经完成了半年,我们需要在代码上添加日志框架。例如:输入/退出功能并发生异常是常见的要求。我想使用AOP来完成。

但是,spring.net AOP是面向接口的,代理只用于接口,一个类需要继承一个接口才能代理.Microsoft Enterprise库也是。 peoblem是我们有很多不继承接口的类。因此,如果我们改变代码结构将需要很多提供,这不是一个好方法.PostSharp通过Attribute实现AOP,它可能适合我们,但PostSharp2.0不是free.NAspect可以找到很少的信息。

以上解决方案是流行的AOP解决方案,我希望使用成熟的框架来解决而不是自己编码。性能和扩展对我们很重要。

我想在我们的AOP上使用AOP代码,直接在类上使用(不要继承接口),你有什么解决方案吗,请帮帮我。谢谢。

解决方案

尝试微软的语义记录。它实现起来有点复杂,但它有优势。



http://channel9.msdn.com/posts/Introducing-Semantic-Logging [ ^ ]


Log4net使用非常简单但功能强大的日志选项



请提供以下链接



如何使用log4net [ ^

Now our project has done half of year, we need to add logging framework on our code.For example:Enter/Exit funtion and occur exception is common requirement.I'd like to use AOP to finish.
But,spring.net AOP is face to interface, proxy only to use on interface,a class need inherit an interface can be proxy.Microsoft Enterprise library is also. The peoblem is we have lots of class that don't inherit interface. So if we change code structure will take a lot of offer, it is not a good way.PostSharp implement AOP through Attribute, it may be suitable for us, but PostSharp2.0 is not free.NAspect has little information can be found.
Above solutions are popular AOP solution, I hope use maturing framework to solve rather than coding by myself.Performance and extension are important to us.
I want to use AOP on our code, directly use on a class (don't inherit interface), do you have any solution, please help me.Thank you.

解决方案

Try Semantic Logging from Microsoft. It's little complex to implement, but it has advantages.

http://channel9.msdn.com/posts/Introducing-Semantic-Logging[^]


Log4net is very simple to use yet powerful logging option

please reffer the following link

How to use log4net[^]


这篇关于在大型项目上实施日志系统的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆