{"action":"opened","issue":{"url":"https://api.github.com/repos/akkadotnet/akka.net/issues/2408","repository_url":"https://api.github.com/repos/akkadotnet/akka.net","labels_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/2408/labels{/name}","comments_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/2408/comments","events_url":"https://api.github.com/repos/akkadotnet/akka.net/issues/2408/events","html_url":"https://github.com/akkadotnet/akka.net/issues/2408","id":194670732,"number":2408,"title":"ActorCell.ReceiveMessage should include the message sender in the message it creates","user":{"login":"JerryRubinow","id":19841096,"avatar_url":"https://avatars.githubusercontent.com/u/19841096?v=3","gravatar_id":"","url":"https://api.github.com/users/JerryRubinow","html_url":"https://github.com/JerryRubinow","followers_url":"https://api.github.com/users/JerryRubinow/followers","following_url":"https://api.github.com/users/JerryRubinow/following{/other_user}","gists_url":"https://api.github.com/users/JerryRubinow/gists{/gist_id}","starred_url":"https://api.github.com/users/JerryRubinow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JerryRubinow/subscriptions","organizations_url":"https://api.github.com/users/JerryRubinow/orgs","repos_url":"https://api.github.com/users/JerryRubinow/repos","events_url":"https://api.github.com/users/JerryRubinow/events{/privacy}","received_events_url":"https://api.github.com/users/JerryRubinow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-09T18:57:59Z","updated_at":"2016-12-09T18:57:59Z","closed_at":null,"body":"When I turn on receive logging (by making actors derive from ILogReceive), I would like to know the sender of the messages that are logged.  There is no way to add that information after the fact - by the time the message hits the logger, the real sender is unavailable.\r\n\r\nIt would be possible to put a log.Debug() in every Receive in my code, but there wouldn't be an easy way to turn this on/off, and it would be a big pain to have explicit logs everywhere, especially when Akka already has a built-in system for doing just that.\r\n\r\nWhat I propose is to change the Publish line in ActorCell.ReceiveMessage\r\n\r\n`\r\n        internal void ReceiveMessage(object message)\r\n        {\r\n            var wasHandled = _actor.AroundReceive(_state.GetCurrentBehavior(), message);\r\n\r\n            if (System.Settings.AddLoggingReceive && _actor is ILogReceive)\r\n            {\r\n                //TODO: akka alters the receive handler for logging, but the effect is the same. keep it this way?\r\n                Publish(new Debug(Self.Path.ToString(), _actor.GetType(),\r\n                    \"received \" + (wasHandled ? \"handled\" : \"unhandled\") + \" message \" + message));\r\n            }\r\n        }\r\n`\r\n\r\nto:\r\n`\r\n                Publish(new Debug(Self.Path.ToString(), _actor.GetType(),\r\n                    \"received \" + (wasHandled ? \"handled\" : \"unhandled\") + \" message \" + message\r\n                    \" from \" + Sender.Path.Name));\r\n`\r\n\r\nLink to file:\r\nhttps://github.com/akkadotnet/akka.net/blob/d86eb6eb4fe512aac603cbc20bddc420acaec74a/src/core/Akka/Actor/ActorCell.DefaultMessages.cs#L173-L174\r\n"}}
{"actor":{"display_login":"JerryRubinow"}}