【发布时间】:2016-05-15 10:33:45
【问题描述】:
除非我完全想念它,否则我的印象是NLog documentation 在其示例中使用${basedir},而没有解释它的位置应该是什么。
我在哪里可以找到列出所有可能选项以及有意义的描述的信息?
我已经定义了这个配置:
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" throwExceptions="true">
<targets>
<target name="file" xsi:type="File"
layout="${longdate} ${logger} ${message}"
fileName="${basedir}/logs/${shortdate}.txt"
keepFileOpen="false"
encoding="iso-8859-2" />
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="file" />
</rules>
</nlog>
据我所知,它可以工作,但我不知道它在哪里记录任何内容。
【问题讨论】:
-
记得在 Visual Studio 中更改文件属性,以便将 NLog-config-file 复制到输出目录 => 始终。或者将 nlog-config 注入 app.config gist.github.com/Chrisso/1703644
标签: c# .net vb.net logging nlog