@@ -291,6 +291,17 @@ class Net_Syslog
291
291
*/
292
292
private $ _appname ;
293
293
294
+ /**
295
+ * Constructor of class
296
+ *
297
+ * @param string $hostname Optional. Sender hostname.
298
+ * @param string $appname Optional. AppName as defined in RFC 5424.
299
+ * @param string $protocol Optional. Can be NET_SYSLOG_UDP, NET_SYSLOG_TCP, NET_SYSLOG_SSL or NET_SYSLOG_TLS.
300
+ * @param string $procid Optional. ProcID as defined in RFC 5424.
301
+ *
302
+ * @access public
303
+ * @see Net_Syslog
304
+ */
294
305
public function Net_Syslog ($ hostname = "" , $ appname = NET_SYSLOG_NILVALUE ,
295
306
$ protocol = NET_SYSLOG_UDP , $ procid = NET_SYSLOG_NILVALUE
296
307
) {
@@ -334,6 +345,13 @@ public function Net_Syslog($hostname = "", $appname = NET_SYSLOG_NILVALUE,
334
345
$ this ->_port = 514 ;
335
346
}
336
347
348
+ /**
349
+ * Function to get local server address when not available
350
+ *
351
+ * @return string Local server address
352
+ *
353
+ * @access private
354
+ */
337
355
private function getServerAddress ()
338
356
{
339
357
if (array_key_exists ('SERVER_ADDR ' , $ _SERVER ))
@@ -501,6 +519,15 @@ private function closeSocket ()
501
519
$ this ->_socket = NULL ;
502
520
}
503
521
522
+ /**
523
+ * Function to send a log message RFC3164 compliant
524
+ *
525
+ * @param int $priority Optional. Priority of message. Is a sum of Severity and Criticity.
526
+ * @param string $content Optional. Message content.
527
+ *
528
+ * @access public
529
+ * @see Net_Syslog
530
+ */
504
531
public function logger3164 ($ priority = 133 , $ content = "Default content " )
505
532
{
506
533
$ rfc = $ this ->_rfc ;
@@ -509,6 +536,17 @@ public function logger3164($priority = 133, $content = "Default content")
509
536
$ this ->_rfc = $ rfc ;
510
537
}
511
538
539
+ /**
540
+ * Function to send a log message RFC542X compliant
541
+ *
542
+ * @param int $priority Optional. Priority of message. Is a sum of Severity and Criticity.
543
+ * @param string $content Optional. Message content.
544
+ * @param string $msgid Optional. MsgID of the message, according to RFC5424.
545
+ * @param string $structured_data Optional. Structured data of the message, according to RFC5424.
546
+ *
547
+ * @access public
548
+ * @see Net_Syslog
549
+ */
512
550
public function logger542X ($ priority = 133 , $ content = "Default content " ,
513
551
$ msgid = "- " , $ structured_data = "- "
514
552
) {
@@ -518,6 +556,17 @@ public function logger542X($priority = 133, $content = "Default content",
518
556
$ this ->_rfc = $ rfc ;
519
557
}
520
558
559
+ /**
560
+ * Function to send a log message. RFC3164 or 542X chosen according to $_rfc parameter.
561
+ *
562
+ * @param int $priority Optional. Priority of message. Is a sum of Severity and Criticity.
563
+ * @param string $content Optional. Message content.
564
+ * @param string $msgid Optional. MsgID of the message, according to RFC5424. Ignored in RFC3164 mode.
565
+ * @param string $structured_data Optional. Structured data of the message, according to RFC5424. Ignored in RFC3164 mode.
566
+ *
567
+ * @access public
568
+ * @see Net_Syslog
569
+ */
521
570
public function logger ($ priority = 133 , $ content = "Default content " ,
522
571
$ msgid = "- " , $ structured_data = "- "
523
572
) {
0 commit comments