protected function flushLogger()
    {
        if ($this->logger instanceof \Yiisoft\Log\Logger) {
            $this->logger->flush(true);
            // attempt to invoke logger destructor:
            unset($this->logger);
        }
        // TODO how?
        // Yii::setLogger(null);
    }