Core: Log messages after sending them to the app

The queueToLog() method was consuming the fields of some of the messages and the app was receiving incorrectly parsed messages.

This closes #1050
Merge pull request #1056 from arthurbenemann/issue1050

Core: Log messages after sending them to the app