Added ability to write logs into MongoDB