path = $path; $this->messageType = $messageType; $this->extraHeaders = $extraHeaders; } public static function factory($path, $messageType = 3, $extraHeaders = '') { return new SS_LogFileWriter($path, $messageType, $extraHeaders); } /** * Write the log message to the file path set * in this writer. */ public function _write($event) { if(!$this->_formatter) { $formatter = new SS_LogErrorFileFormatter(); $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); } }