Add factory and test LoggerFactory and LoggerMiddleware