C# 读取和修改自定义config文件
现有个NLog.Config文件,内容如下
我现在要动态修改<rules>节点下logger的minlevel属性。试过多种方法,无法获取,求指教!
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
autoReload="true">
<!--
See https://github.com/nlog/nlog/wiki/Configuration-file
for information on customizing logging rules and outputs.
-->
<targets>
<!-- add your targets here -->
<!--<target xsi:type="File" name="f" fileName="${basedir}/nlogs/${shortdate}.log"
layout="${longdate} [${uppercase:${level}}] [${callsite}] : ${message}" />-->
<target xsi:type="File" name="fee" fileName="${basedir}/nlogs/${shortdate}.log"
layout="${time} ${uppercase:${level}} ${message}" />
</targets>
<rules>
<!-- add your logging rules here -->
<logger name="*" minlevel="trace" writeTo="fee" />
<!--<logger name="f2" minlevel="trace" writeTo="f2" />-->
</rules>
</nlog>
我现在要动态修改<rules>节点下logger的minlevel属性。试过多种方法,无法获取,求指教!
...全文


