Put logging in backend

Fixes #323
Yeah the point is to have a lot of messages so when something goes wrong it'll be easy to figure out what it was.