Adding logging to sendJSONMessage