private function _createCurrentStream($priorityName, $subPriority = null)
    {
        $priorityName = strtolower($priorityName);

        if ($subPriority !== null) {
            $priorityName = strtolower($subPriority);
        }

        $streamDir = $this->baseDir . DIRECTORY_SEPARATOR . str_ireplace('-', DIRECTORY_SEPARATOR, $this->date->format('Y-m-d'));

        if (!is_dir($streamDir)) {
            umask(0000);
            if (!mkdir($streamDir, 0777, true)) {
                $msg = "Dir '$streamDir' cannot be created";
                throw new \Zend_Log_Exception($msg);
            }

            $this->shutdown($priorityName);
        }

        $filepath = $streamDir . DIRECTORY_SEPARATOR . $priorityName . '.log';
        if (!$this->streams[$priorityName] = @fopen($filepath, $this->mode, false)) {
            $msg = "File '$filepath' cannot be opened with mode '$this->mode'";
            throw new \Zend_Log_Exception($msg);
        }

        return $this->streams[$priorityName];
    }