Add logging in and out