Refactored logging to make use of a singleton service class called LoggingService.