Factor out logging config, call from wsgi script.

Previously we were only configuring the logger from the cli tool.
Merge pull request #366 from zenhack/wsgi-logging

Factor out logging config, call from wsgi script.