LOGS); $this->_path = $options['path']; } /** * Implements writing to log files. * * @param string $type The type of log you are making. * @param string $message The message you want to log. * @return boolean success of write. */ public function write($type, $message) { $debugTypes = array('notice', 'info', 'debug'); if ($type == 'error' || $type == 'warning') { $filename = $this->_path . 'error.log'; } elseif (in_array($type, $debugTypes)) { $filename = $this->_path . 'debug.log'; } else { $filename = $this->_path . $type . '.log'; } $output = date('Y-m-d H:i:s') . ' ' . ucfirst($type) . ': ' . $message . "\n"; return file_put_contents($filename, $output, FILE_APPEND); } }