Changed console outputs to logger.