Singleton logger, static logger, factory logger… how to log?

后端 未结 3 1097
南方客
南方客 2021-02-08 12:21

I am wrapping the patterns & practices Enterprise Library Logging Application Block for an application written in .NET.

I want to be able to subclass a logger (i.e t

3条回答
  •  醉话见心
    2021-02-08 12:54

    You could even do better than that. Write a wrapper class that wraps either Nlog or log4net or whatnot. You can then use that wrapper class (maybe use an interface to it if you really want to decouple things) in your code. This way, if you decide to change logger class, you need to change just one class and not edit all your classes.

提交回复
热议问题