Python application - logging heartbeats in MongoDB