pull out log framework sensitive logic from the controller into a separate service.