Added custom logger as a parameter.