added logging of messages, and push of messages to websockets. refactored message logging to match websockets