Skip to content

Commit

Permalink
Append message content to deadletter log message (#6448)
Browse files Browse the repository at this point in the history
Co-authored-by: Aaron Stannard <aaron@petabridge.com>
  • Loading branch information
Arkatufus and Aaronontheweb authored Feb 26, 2023
1 parent 4da2f29 commit 994f1e7
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/core/Akka/Event/DeadLetterListener.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,19 @@ private void LogDeadLetter(AllDeadLetters d, string doneMsg)
$"If this is not an expected behavior then {d.Recipient} may have terminated unexpectedly. ";
break;
}
_eventStream.Publish(new Info(
d.Recipient.Path.ToString(),
d.Recipient.GetType(),
logMessage +

logMessage +=
"This logging can be turned off or adjusted with configuration settings 'akka.log-dead-letters' " +
"and 'akka.log-dead-letters-during-shutdown'."));
"and 'akka.log-dead-letters-during-shutdown'.";

// Check that unwrapped object has an overriden ToString() method
var content = unwrapped?.ToString() ?? "null";
if (!content.Equals(messageStr))
{
logMessage += $" Message content: {content}";
}

_eventStream.Publish(new Info(d.Recipient.Path.ToString(), d.Recipient.GetType(), logMessage));
}

private bool IsReal(IActorRef snd)
Expand Down

0 comments on commit 994f1e7

Please sign in to comment.