PHP code example of arashdalir / php-psr3log
1. Go to this page and download the library: Download arashdalir/php-psr3log 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/ */
arashdalir / php-psr3log example snippets
= new ArashDalir\Handler\SysLog\SysLog('127.0.0.1');
$udp->getLogMessage()->setFacility(LOG_AUTH, false)
->setVersion(\ArashDalir\Handler\SysLog\SysLogMessage::VERSION_1) // available as of V1.1.0
->setHostname('ada')
->setProcessId(8848)
->setMessageId('demo')
->setAppName('php');
$udp->error('UDP SysLog Error Test');
$udp->info('UDP SysLog Info Test');
$udp->debug('UDP SysLog Debug Test');
$udp->emergency('UDP SysLog Emergency Test');
$local = new \ArashDalir\Handler\SysLog\SysLog();
$local->getLogMessage()->setFacility(LOG_USER)
->setHostname('ada')
->setProcessId(8848)
->setMessageId('demo')
->setAppName('php');
$local->error('Local SysLog Error Test');
$local->info('Local SysLog Info Test');
$local->debug('Local SysLog Debug Test');
$local->emergency('Local SysLog Emergency Test');
json
{
"ashdalir/php-psr3log": "dev-master"
}
}