Skip to content

Commit

Permalink
feat: Include additional DebugInformation when failing with exception
Browse files Browse the repository at this point in the history
  • Loading branch information
snakefoot authored and markmcdowell committed Jun 17, 2021
1 parent 33362fa commit 00403ea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/NLog.Targets.ElasticSearch/ElasticSearchTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ private void SendBatch(ICollection<AsyncLogEventInfo> logEvents)
var exception = result.Success ? null : result.OriginalException ?? new Exception("No error message. Enable Trace logging for more information.");
if (exception != null)
{
InternalLogger.Error(exception.FlattenToActualException(), $"ElasticSearch: Failed to send log messages. Status={result.HttpStatusCode} Uri={result.Uri}");
InternalLogger.Error(exception.FlattenToActualException(), $"ElasticSearch: Failed to send log messages. Status={result.HttpStatusCode} Uri={result.Uri} DebugInformation={result.DebugInformation}");
}
else if (InternalLogger.IsTraceEnabled)
{
Expand Down

0 comments on commit 00403ea

Please sign in to comment.