I am using loggly with NLog in C#.
When I use, for example, the following code.
protected static readonly NLog.Logger _log = NLog.LogManager.GetCurrentClassLogger();
try
{
...
}
catch (Exception ex)
{
_log.Error(ex, "UpdateBrokerData {Account}", accountBalanceDto.Account);
}
The exception message is displayed but none of the inner exceptions.
Is there a way to get this to happen (perhaps with a setting in the NLog.config?
Here is the loggly part of my NLog.config file.
<target name="Loggly" xsi: type="Loggly">
<layout xsi:type="JsonLayout" includeAllProperties="true" excludeProperties="">
<attribute name="environment" layout="${environment:ASPNETCORE_ENVIRONMENT}" />
<attribute name="time" layout="${longdate}" />
<attribute name="level" layout="${level:upperCase=true}"/>
<attribute name="message" layout="${message}" />
</layout>
</target>