Fix undefined method `logger` for nil Class