/** * Output the message to Prowl * * @param string $message * * @return void */ public function write($message) { if (!in_array($message, self::$aMessages) && $this->enabled) { $this->sendProwlMessage($message); self::$aMessages[] = $message; } parent::written(); }
/** * @param $msg string string to add to the file */ public function write($msg) { if ($this->enabled) { $this->openFH(); $msg = $this->prepareMessage($msg); $msg .= "\n"; fputs($this->fh, $msg, strlen($msg)); } parent::written(); }
/** * Send the message to SysLog * * @param string $message * * @return ChannelAbstract|void */ public function write($message) { parent::write($message); $this->openLog(); // map our log level to a syslog level switch ($this->level) { case 'debug': $syslog_level = LOG_DEBUG; break; case 'notice': $syslog_level = LOG_NOTICE; break; case 'info': $syslog_level = LOG_INFO; break; case 'alert': case 'warn': case 'warning': $syslog_level = LOG_WARNING; break; case 'emergency': case 'critical': case 'error': case 'fatal': $syslog_level = LOG_ERR; break; default: $syslog_level = LOG_NOTICE; } $message = $this->prepareMessage($message, array('time', 'level')); syslog($syslog_level, $message); parent::written(); }
/** * Send the message to Growl * * @param string $message * * @return ChannelAbstract|void * @throws \Net_Growl_Exception */ public function write($message) { if ($this->functional) { if ($this->enabled) { $growl_options = array('host' => $this->growl_host, 'protocol' => $this->growl_protocol, 'port' => $this->growl_port, 'timeout' => $this->growl_timeout); try { $growl = @\Net_Growl::singleton($this->applicationName, $this->growl_notifications, $this->growl_password, $growl_options); $growl_name = GROWL_NOTIFY_STATUS; $growl->notify($growl_name, $this->applicationName, $message, $growl_options); $growl = null; } catch (\Net_Growl_Exception $ex) { $this->functional = false; } } parent::written(); } }