在多个项目中共享log4net的配置 [英] Share log4net configuration across multiple projects

查看:352
本文介绍了在多个项目中共享log4net的配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的WCF的解决方案,我有这样的解决方案下的多个项目(16)。 (Business Objects公司,业务层,Windows服务等)

In my WCF solution, I have multiple projects(16) under this solution. (Business Objects, Business Layer, Windows services etc.)

我要log4net的日志框架集成到所有项目。
什么是最好的办法让所有的项目共享一个log4net的配置文件。

I need to integrate log4net logging framework to all projects. What would be the best approach to have a one log4net config file shared across all the projects.

推荐答案

Visual Studio中,您可以从解决方案级别链接文件到项目层面。我会用这种方法比硬编码在路径的方法。

Visual Studio allows you to link files from the solution level down to the project level. I would use this approach over the approach of hard coding at path.

Add > Existing Item > Add As Link

为了清晰看到图像。

See the image for clarity.

这篇关于在多个项目中共享log4net的配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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