开发者

How do I control WCF logging from a log4net config file?

We do all our logging with log4net, our support staff etc know how to edit the log4net config files. We are now making use of WCF in our apps.

Therefore how can I enable the WCF built in logging to be controlle开发者_开发问答d from the log4net config file, so that there is a single way to control all logging.


I suggest to implement IParameterInspector and/or IDispatchMessageInspector, and use log4net classes inside that implementations. In this case you'll stick to log4net and it it's not hard (via attributes) to enable logging on your services.


the naive approach will be to have a default configuration for WCF in app.config which you can override from code on application startup with values taken from log4net using System.Configuration classes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜