BUG Attempt to create log path before writing file

Attempt to create the path a log file will be written to before blindly
attempting to write the file. This makes dynamically named log paths
(i.e. rotation by date) possible.
This commit is contained in:
Simon Elvery 2012-07-17 12:18:35 +10:00
parent 938bf14d16
commit dbc862e784

View File

@ -58,6 +58,7 @@ class SS_LogFileWriter extends Zend_Log_Writer_Abstract {
$this->setFormatter($formatter);
}
$message = $this->_formatter->format($event);
if(!file_exists(dirname($this->path))) mkdir(dirname($this->path), 0755, true);
error_log($message, $this->messageType, $this->path, $this->extraHeaders);
}