Made working example

This commit adds logging functionality, and proposes and example that
writes output to a MongoDB