Added logger for message inserting

By sending messages, the message is now logged as a json.