move logging to common MongoDB connection