Updated /log route to use new MongoDB connection handling.