Log attemptes to view protected resources and return the correct status code