Update rfc3164.proto.php
This commit is contained in:
parent
99284792a8
commit
599b97c6f3
|
@ -2,6 +2,7 @@
|
||||||
/* @file rfc3164.proto.php
|
/* @file rfc3164.proto.php
|
||||||
* @author Go Namhyeon <gnh1201@gmail.com> (Modified)
|
* @author Go Namhyeon <gnh1201@gmail.com> (Modified)
|
||||||
* @author Troy Davis (@tory) - https://gist.github.com/troy/2220679 (Original)
|
* @author Troy Davis (@tory) - https://gist.github.com/troy/2220679 (Original)
|
||||||
|
* @brief Helper for RFC3164(The BSD Syslog Protocol) - https://tools.ietf.org/html/rfc3164
|
||||||
* @created_on 2018-03-02
|
* @created_on 2018-03-02
|
||||||
* @updated_on 2020-01-23
|
* @updated_on 2020-01-23
|
||||||
*/
|
*/
|
||||||
|
@ -24,7 +25,7 @@ if(check_function_exists("rfc3164_send_message")) {
|
||||||
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
|
$sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
|
||||||
foreach(explode("\n", $message) as $line) {
|
foreach(explode("\n", $message) as $line) {
|
||||||
$syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line;
|
$syslog_message = "<22>" . date('M d H:i:s ') . $program . ' ' . $component . ': ' . $line;
|
||||||
socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, PAPERTRAIL_HOSTNAME, PAPERTRAIL_PORT);
|
socket_sendto($sock, $syslog_message, strlen($syslog_message), 0, $hostname, $port);
|
||||||
}
|
}
|
||||||
socket_close($sock);
|
socket_close($sock);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user