Adds proper logging