考虑NLog.config中的以下配置文件
<?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 async="true">
<target xsi:type="Trace" name="DebugView"
rawWrite="true"
layout="NEX|${pad:padding=-5:inner=${uppercase:${level}}}|${pad:padding=-16:inner=${callsite:className=true:fileName=false:includeSourcePath=false:methodName=false:includeNamespace=false}}|${message}" />
<target xsi:type="File" name="LogFile"
filename="${environment:variable=UserProfile}/logs/TA.Nexdome.Server-${filesystem-normalize:fSNormalize=true:inner=${shortdate}-${windows-identity}-${machinename}.log}"
layout="${time}|${pad:padding=-5:inner=${uppercase:${level}}}|${pad:padding=-16:inner=${callsite:className=true:fileName=false:includeSourcePath=false:methodName=false:includeNamespace=false}}|${message}" />
</targets>
<rules>
<logger name="*" minlevel="Trace" writeTo="DebugView" />
<logger name="*" minlevel="Trace" writeTo="LogFile" />
</rules>
</nlog>对于目标name="DebugView",如果我修改布局定义以从开头删除文字文本NEX|,那么我根本得不到任何输出。
如果我把任何东西放在${pad前面,即使只有一个|,我也会得到输出。
这会不会是布局逻辑中的一个bug?
发布于 2019-06-11 04:29:46
https://stackoverflow.com/questions/56519116
复制相似问题