core/Logger.php
private static function send($type, $args)
    {
        if (!(defined('DEBUG_LOG') && DEBUG_LOG)) {
            return;
        }
        if (!get_extension_funcs('sockets')) {
            return;
        }
        $backtrace = debug_backtrace(false);
        $backtrace_message = 'unknown';
        if (isset($backtrace[1]) && isset($backtrace[1]['file']) && isset($backtrace[1]['line'])) {
            $backtrace_message = $backtrace[1]['file'] . '(' . $backtrace[1]['line'].')';
        }
        foreach ($args as &$arg) {
            try {
                $arg = self::convert($arg);
            } catch (\ReflectionException $exception) {
            }
        }
        $data = [];
        $data[0] = $args;
        $data[1] = $backtrace_message;
        $data[2] = $type;
        $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
        $msg = json_encode($data);
        $len = strlen($msg);
        try {
            socket_sendto($sock, $msg, $len, 0, Config::get('beacon.log_udp_addr', '127.0.0.1'), Config::get('beacon.log_udp_port', 1024));
            socket_close($sock);
        } catch (\Exception $e) {

        } catch (\Error $e) {

        }
    }
private static function send($type, $args)
    {
        if (!(defined('DEBUG_LOG') && DEBUG_LOG)) {
            return;
        }
        if (!get_extension_funcs('sockets')) {
            return;
        }
        $backtrace = debug_backtrace(false);
        $backtrace_message = 'unknown';
        if (isset($backtrace[1]) && isset($backtrace[1]['file']) && isset($backtrace[1]['line'])) {
            $backtrace_message = $backtrace[1]['file'] . '(' . $backtrace[1]['line'].')';
        }
        foreach ($args as &$arg) {
            try {
                $arg = self::convert($arg);
            } catch (\ReflectionException $exception) {
            }
        }
        $data = [];
        $data[0] = $args;
        $data[1] = $backtrace_message;
        $data[2] = $type;
        $sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
        $msg = json_encode($data);
        $len = strlen($msg);
        try {
            socket_sendto($sock, $msg, $len, 0, Config::get('beacon.log_udp_addr', '127.0.0.1'), Config::get('beacon.log_udp_port', 1024));
            socket_close($sock);
        } catch (\Exception $e) {

        } catch (\Error $e) {

        }
    }
UDP发送
@param $type
@param $args