wsgi file, improve logging and error reporting