Fixed the way logging is set up by making sure that eliding calls does not lead to null pointer exceptions.