C# NLog不';t从XML配置加载规则
配置文件(变量除外)包含以下数据:C# NLog不';t从XML配置加载规则,c#,logging,nlog,C#,Logging,Nlog,配置文件(变量除外)包含以下数据: <?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" throwExceptions="false"> <
<?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"
throwExceptions="false">
<extensions>
<add assembly="NLog.Extended" />
</extensions>
<targets async="True">
<target name="TraceLogger"
type="File"
fileName="${TraceFullPath}"
archiveFileName="${TraceArchiveFullPath}"
maxArchiveFiles="100"
archiveNumbering="Sequence"
archiveEvery="None"
layout="${message}" />
</targets>
<rules>
<logger name="*"
minLevel="Trace"
writeTo="TraceLogger"
enabled="True" />
</rules>
</nlog>
调试器显示以下对象的下一个属性值:
configuration.base.LogginRules: Count = 0
configuration.base.AllTargets: Count = 0
logger.Is...Enabled = false (for all levels)
知道我做错了什么吗?问题很简单:变量和目标值的大小写错误
很抱歉占用了您的时间请尝试将
ThroweExceptions
设置为true
。您的.config可能有问题。不幸的是,不是:(.我在谷歌上搜索了NLog疑难解答,并完成了查找错误的步骤,logger开始完美工作,甚至我对变量和目标的更改也是如此
configuration.base.LogginRules: Count = 0
configuration.base.AllTargets: Count = 0
logger.Is...Enabled = false (for all levels)