fixes local WSGI reference
adds more logging for production