From be7720d5aaf99ccb3d75e962fab0446a0c76077e Mon Sep 17 00:00:00 2001 From: leirn Date: Wed, 18 Sep 2013 16:25:51 +0200 Subject: [PATCH] Complete docbooks comments --- syslog.class.php | 49 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/syslog.class.php b/syslog.class.php index 5a7c179..306dab7 100644 --- a/syslog.class.php +++ b/syslog.class.php @@ -291,6 +291,17 @@ class Net_Syslog */ private $_appname; + /** + * Constructor of class + * + * @param string $hostname Optional. Sender hostname. + * @param string $appname Optional. AppName as defined in RFC 5424. + * @param string $protocol Optional. Can be NET_SYSLOG_UDP, NET_SYSLOG_TCP, NET_SYSLOG_SSL or NET_SYSLOG_TLS. + * @param string $procid Optional. ProcID as defined in RFC 5424. + * + * @access public + * @see Net_Syslog + */ public function Net_Syslog($hostname = "", $appname = NET_SYSLOG_NILVALUE, $protocol = NET_SYSLOG_UDP, $procid = NET_SYSLOG_NILVALUE ) { @@ -334,6 +345,13 @@ public function Net_Syslog($hostname = "", $appname = NET_SYSLOG_NILVALUE, $this->_port = 514; } + /** + * Function to get local server address when not available + * + * @return string Local server address + * + * @access private + */ private function getServerAddress() { if(array_key_exists('SERVER_ADDR', $_SERVER)) @@ -501,6 +519,15 @@ private function closeSocket () $this->_socket = NULL; } + /** + * Function to send a log message RFC3164 compliant + * + * @param int $priority Optional. Priority of message. Is a sum of Severity and Criticity. + * @param string $content Optional. Message content. + * + * @access public + * @see Net_Syslog + */ public function logger3164($priority = 133, $content = "Default content") { $rfc = $this->_rfc; @@ -509,6 +536,17 @@ public function logger3164($priority = 133, $content = "Default content") $this->_rfc = $rfc; } + /** + * Function to send a log message RFC542X compliant + * + * @param int $priority Optional. Priority of message. Is a sum of Severity and Criticity. + * @param string $content Optional. Message content. + * @param string $msgid Optional. MsgID of the message, according to RFC5424. + * @param string $structured_data Optional. Structured data of the message, according to RFC5424. + * + * @access public + * @see Net_Syslog + */ public function logger542X($priority = 133, $content = "Default content", $msgid = "-", $structured_data = "-" ) { @@ -518,6 +556,17 @@ public function logger542X($priority = 133, $content = "Default content", $this->_rfc = $rfc; } + /** + * Function to send a log message. RFC3164 or 542X chosen according to $_rfc parameter. + * + * @param int $priority Optional. Priority of message. Is a sum of Severity and Criticity. + * @param string $content Optional. Message content. + * @param string $msgid Optional. MsgID of the message, according to RFC5424. Ignored in RFC3164 mode. + * @param string $structured_data Optional. Structured data of the message, according to RFC5424. Ignored in RFC3164 mode. + * + * @access public + * @see Net_Syslog + */ public function logger($priority = 133, $content = "Default content", $msgid = "-", $structured_data = "-" ) {