refacto setLogger method