`$this->logger` can be null. You need to test its present first.