unhandled messages in akka 2.0.5

78 views
Skip to first unread message

Sam Halliday

unread,
Jan 21, 2014, 1:14:21 PM1/21/14
to akka...@googlegroups.com
Hi all,

I'm constrained to Scala 2.9.2 and Akka 2.0.5 on my project and I am confused how unhandled messages are intended to be logged.

It seems that in order to get any form of logging, the receive method must use the LoggingReceive wrapper. This then shows handled and unhandled messages in the logs thanks to akka.actor.debug.receive. This is a bit of a pain as I'd rather not have to use a wrapper in the code to enable logging, I'd expect it to be a purely configuration setting.

But even without the LoggingReceive, the unhandled messages are being sent to

  context.system.eventStream.publish(UnhandledMessage(message, sender, self))

from the Actor's default "unhandled" body.

But this never seems to be logged? Changing akka.actor.debug.unhandled does nothing (maybe this was added in 2.1?) nor does changing akka.actor.debug.event-stream.

Given that catching unhandled messages is a critical part of the dev / test cycle, I'm really very keen to be able to log these messages.

I've resorted to overriding the unhandled method and using the SLF4J logger in there, but what is the "correct" way to do this?

Best regards,
Sam

Akka Team

unread,
Jan 22, 2014, 4:51:24 AM1/22/14
to Akka User List
Hi Sam,

Can't you just subscribe to the event stream and log the event?

-Endre


--
>>>>>>>>>> Read the docs: http://akka.io/docs/
>>>>>>>>>> Check the FAQ: http://akka.io/faq/
>>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to akka-user+...@googlegroups.com.
To post to this group, send email to akka...@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/groups/opt_out.



--
Akka Team
Typesafe - The software stack for applications that scale
Blog: letitcrash.com
Twitter: @akkateam

Samuel Halliday

unread,
Jan 22, 2014, 2:26:02 PM1/22/14
to akka...@googlegroups.com
Oh, ok, thanks. I guess even that part was added in 2.1.

I’m also having trouble logging dead letters. e.g. a tell is sent from non-actor code and then a response is sent. I guess I also need to listen to the event stream for this. Makes one appreciate how much work goes into the point releases!

--
Best regards,
Samuel Halliday
> You received this message because you are subscribed to a topic
> in the Google Groups "Akka User List" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/akka-user/87lRz-NykEs/unsubscribe.
> To unsubscribe from this group and all its topics, send an email
Reply all
Reply to author
Forward
0 new messages