Added logging in but will probably switch it out with the flask plugin...