protected function getLogPath()
{
if (!($logdir = $this->getLogDirectory())) {
return null;
}
if (!is_dir($logdir)) {
throw new \RuntimeException("Log directory {$logdir} does not exist or is not a directory.");
}
$logpath = rtrim($logdir, '\\/') . DIRECTORY_SEPARATOR . $this->getLogFilename();
if (file_exists($logpath) && !is_writable($logpath)) {
throw new \RuntimeException("Log file {$logpath} is not writeable.");
}
return $logpath;
}