Correct placement of logging in component