Switch prints to logged errors, refactor fetching the clients IP