Common Infrastructure Libraries for .NET(1)-------Common.Logging Framework
由于Quartz.net用到了Common.Logging组件作为日志的实现方式,有必要学习下。
官方网址:http://netcommon.sourceforge.net/index.html
官方文档: http://netcommon.sourceforge.net/docs/2.1.0/reference/html/index.html
目前比较著名的一些日志模块有:log4net, Enterprise Library Logging, NLog
Common.Logging在抽象层面上担任了适配器的角色,官网有句话:
Common.Logging library introduces a simple abstraction to allow you to select a specific logging implementation at runtime. Thus you can defer the decision what particular logging library to use until deployment. Adapters are used for plugging a particular logging system into Common.Logging.
由于Common Logging是一个日志的基础设施接口,因此更换到其他日志框架,也不需要修改程序代码.
使用方法
1.引用通用接口的Common.Logging.dll
2.然后根据需要引用具体实现的日志模块(log4net, Enterprise Library Logging, NLog),Common.Logging.XXX.dll,起到适配器的作用
3.最后引用XXX.dll
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步