Add before_actions and log control