LogException
or any of the derived functions like ErrorException
etc. seem to totally ignore the exception parameter passed in.
Am I missing a
Add or replace the ${exception}
tag in the layout config to ${exception:format=tostring}
<targets>
<target name="errorLogFile" xsi:type="File" fileName="errors.txt"
layout="${message} ${exception:format=tostring}"/>
</targets>
Building on @Niki's answer, this will give you pretty close to what log4net will do
fileName="${basedir}/logs/${shortdate}.log" layout="${longdate}|${level:uppercase=true}|${logger}|${message}${onexception:inner=${newline}${exception:format=tostring}}"