Add logger and correct logging in ping