私のNLogは次のように構成されています
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<targets>
<target name="file" xsi:type="File" fileName="${basedir}/log${shortdate}.txt" archiveAboveSize="500000" archiveEvery="Day" archiveNumbering="Rolling" maxArchiveFiles="10" layout="${date:format=s}|${level}|${callsite}|${identity}|${message}|${exception:format=stacktrace}"/>
<!--<target name="console" xsi:type="Console" />-->
</targets>
<rules>
<logger name="*" minlevel="Debug" writeTo="file" />
<!--<logger name="*" minlevel="Debug" writeTo="console" />-->
</rules>
</nlog>
ただし、例外が発生したときにスタックトレースが記録されていません。NLog にバグはありますか?
Nlog のラッパーを作成し、次のようにログを記録しています
public void Error(string message, Exception ex)
{
logger.Error(message, ex);
}
ログにメッセージが表示されますが、スタックトレースには表示されません。
前もって感謝します