我已将NLog添加到我的项目和开发环境中,它工作正常。NLog不写入
我创建了一个安装文件来部署我的应用程序。 NLog.config文件在安装项目中没有显示为依赖项。所以,我将它添加为一个文件,并在部署时与exe文件和App.config位于同一目录中。
它不做任何记录。我不知道为什么。下面是配置文件:
<?xml version="1.0" encoding="utf-8" ?>
<?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">
<variable name="day" value="${date:format=dd}" />
<variable name="month" value="${date:format=MM}" />
<variable name="year" value="${date:format=yyyy}" />
<variable name="verbose" value="${longdate} | ${level} | ${message} | ${exception:format=tostring,message,method:maxInnerExceptionLevel=5:innerFormat=shortType,message,method}}" />
<targets>
<target name="logfile" xsi:type="File" fileName="${basedir}/Logs/${year}${month}${day}.log" layout="${verbose}" />
</targets>
<rules>
<logger name="*" minlevel="Error" writeTo="logfile" />
</rules>
</nlog>
任何帮助将是巨大的。干杯!
xsi标签卡住一个错误。我怎样才能在那里获得架构? – onefootswill 2012-04-23 23:06:14
粘贴您自己的配置,xmlns属性和全部。为了可读性,我删除了一些东西(因此是点)。也;见例如http://snipplr.com/view/24560/和http://nlog-project.org/wiki/Visual_Studio_support – BaBu 2012-04-24 06:07:57
这东西看起来不错。我会着手解决这个问题。 – onefootswill 2012-04-26 03:42:10