首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >当我的布局以${pad...}开始时,为什么NLog不产生任何输出?

当我的布局以${pad...}开始时,为什么NLog不产生任何输出?
EN

Stack Overflow用户
提问于 2019-06-10 07:33:12
回答 1查看 152关注 0票数 0

考虑NLog.config中的以下配置文件

代码语言:javascript
复制
<?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?

EN

回答 1

Stack Overflow用户

发布于 2019-06-11 04:29:46

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56519116

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档