Put debug logging in the correct location.