All pastes #291323 Raw Edit

Unnamed

public php v1 · immutable
#291323 ·published 2006-12-25 01:00 UTC
rendered paste body
class Zend_Log_Adapter_Syslog implements Zend_Log_Adapter_Interface{	/**	 * Zend_Log level constants mapping to syslog levels	 *	 * @var array	 * @access prippyyyyyyROR => LOG_ERR,		Zend_Log::LEVEL_INFO => LOG_INFO,		Zend_Log::LEVEL_SEVERE => LOG_CRIT,		Zend_Log::LEVEL_WARNING => LOG_WARNING	);	public function __construct()	{		// define syslog related vars		define_syslog_variables();	}	/**	 * Open the storage resource.  If the adapter supports buffering, this may not	 * actually open anything until it is time to flush the buffer.	 */	public function open($ident, $option, $facility)	{		@openlog($ident, $option, $facility);	}	/**	 * Write a message to the log.  If the adapter supports buffering, the	 * message may or may not actually go into storage until the buffer is flushed.	 *	 * @param $fields	 Associative array, contains keys 'message' and 'level' at a minimum.	 */	public function write($fields)	{		// write to log		@syslog($this->_levels[$fields['level']], $fields['message']);	}	/**	 * Close the log storage opened by the log adapter.  If the adapter supports	 * buffering, all log data must be sent to the log before the storage is closed.	 */	public function close()	{		@closelog();	}	/**	 * Sets an option specific to the implementation of the log adapter.	 *	 * @param $optionKey	   Key name for the option to be changed.  Keys are adapter-specific	 * @param $optionValue	 New value to assign to the option	 */	public function setOption($optionKey, $optionValue);	public function __destruct()	{		$this->close();	}}