diff --git a/application/libraries/Omeka/Application/Resource/Logger.php b/application/libraries/Omeka/Application/Resource/Logger.php index 9527a490d..205dc46bd 100644 --- a/application/libraries/Omeka/Application/Resource/Logger.php +++ b/application/libraries/Omeka/Application/Resource/Logger.php @@ -27,13 +27,17 @@ public function init() return; } - $logFile = LOGS_DIR . '/' . 'errors.log'; + if (empty($config->log->path)) { + $logFile = LOGS_DIR . '/' . 'errors.log'; + } else { + $logFile = $config->log->path; + } - if (!is_writable($logFile)) { + try { + $writer = new Zend_Log_Writer_Stream($logFile); + } catch (Zend_Log_Exception $e) { throw new RuntimeException('Error log file cannot be written to. Please give this file read/write permissions for the web server.'); } - - $writer = new Zend_Log_Writer_Stream($logFile); $logger = new Zend_Log($writer); if (isset($config->log->priority)) {