Refactored custom logger into a service provider