Switched to using JSONObject for serializing log messages to client.