Log chat messages to mongodb