LogEntries配置中的参数

时间:2015-04-20 13:16:27

标签: c# nlog logentries

使用LogEntries的默认配置,是否可以在布局中创建插入参数化值?

<nlog>
    <extensions>
      <add assembly="LogentriesNLog" />
    </extensions>
    <targets>
      <target name="logentries" type="Logentries" debug="true" httpPut="false" ssl="false" layout="${date:format=ddd MMM dd} ${time:format=HH:mm:ss} ${date:format=zzz yyyy} ${logger} {SOME PARAM FROM CONFIG} : ${LEVEL}, ${message}">

      </target>
    </targets>
    <rules>
      <logger name="*" minLevel="Trace" appendTo="logentries" />
    </rules>
</nlog>

1 个答案:

答案 0 :(得分:0)

我有时候是个白痴。

您可以将它们粘贴在布局字符串

<target name="logentries" type="Logentries" debug="true" httpPut="false" ssl="false" layout="${date:format=ddd MMM dd} ${time:format=HH:mm:ss} ${date:format=zzz yyyy} : ${LEVEL}, ${message}, ${SomeParam}"></target>