He-Pin opened a new issue, #3129:
URL: https://github.com/apache/pekko/issues/3129

   ### Motivation
   
   When a supervisor applies the `Resume` directive to a failed child actor, 
the current `logFailure` implementation logs the exception message as a 
`Warning` but does **not** include the actual exception object. This means 
critical debugging information — such as the stack trace, inner exceptions, and 
exception type — is lost.
   
   In `FaultHandling.scala`, the `logFailure` method correctly passes the 
`cause` to `Error` log events (for Stop/Restart directives):
   
   ```scala
   // Error level (Stop/Restart) - includes exception ✓
   publish(context, Error(cause, child.path.toString, getClass, logMessage))
   ```
   
   But for Warning level (Resume), it only passes the message string:
   
   ```scala
   // Warning level (Resume) - exception object is lost ✗
   publish(context, LogEvent(d.logLevel, child.path.toString, getClass, 
logMessage))
   ```
   
   This makes it significantly harder to diagnose transient failures that are 
handled by Resume, since operators can see the message text but cannot inspect 
the full exception chain or stack trace.
   
   ### Proposed Fix
   
   The `LogEvent` constructor should be called with the `cause` parameter, 
similar to how `Error` log events include the exception:
   
   ```scala
   publish(context, LogEvent(d.logLevel, cause, child.path.toString, getClass, 
logMessage))
   ```
   
   This would allow logging backends (SLF4J, Logback, etc.) to include the full 
exception in the log output for Resume decisions.
   
   ### Impact
   
   - Improved observability for supervised actors that use Resume strategy
   - Better debugging experience for transient failures
   - No breaking API changes — `LogEvent` already supports a `cause` parameter
   
   ### References
   
   This same issue was identified and fixed in the Akka.NET project: 
https://github.com/akkadotnet/akka.net/issues/6071


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to