Made logger optional.