PHP code example of lvht / udplog
1. Go to this page and download the library: Download lvht/udplog library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lvht / udplog example snippets
$log = new Lvht\Udplog('ip addr', 'port');
$log->facility(LOG_KERN)
->hostname('foo.com')
->procid(8848)
->msgid('demo')
->appname('php');
$log->error('欢迎使用基于UDP的syslog协议发送日志!');
$log->info('欢迎使用基于UDP的syslog协议发送日志!');
$log->debug('欢迎使用基于UDP的syslog协议发送日志!');
$log->emergency('欢迎使用基于UDP的syslog协议发送日志!');