add debug logging for addEvent and upload