Web.config中怎么让系统去应用其它的config中的配置

来源:百度知道 编辑:UC知道 时间:2024/06/30 10:54:59
我想用Enterprise Library中的Logger,但不想把配置写在Web.config中,我把配置信息写到了一个log.config中,在Web.config中设置让系统去应用log.config中的配置信息?希望高手们能给段Web.config的设置的代码.

<configSections>
<section name="loggingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Logging.Configuration.LoggingSettings, Microsoft.Practices.EnterpriseLibrary.Logging, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</configSections>
<loggingConfiguration configSource="Config\Log.config"></loggingConfiguration>

可以在 appSettings 下指定单独配置文件

<appSettings file="log.config" ></appSettings>

访问方式同一般的访问 appSetting 一样