PHP code example of yiisoft / log-target-syslog
1. Go to this page and download the library: Download yiisoft/log-target-syslog 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/ */
yiisoft / log-target-syslog example snippets
use Yiisoft\Log\Target\Syslog\SyslogTarget;
$syslogTarget = new SyslogTarget($identity, $options, $facility, $levels);
$syslogTarget = new SyslogTarget(
'app',
LOG_ODELAY | LOG_PID,
LOG_USER,
[LogLevel::ERROR, LogLevel::WARNING]
);
$logger = new \Yiisoft\Log\Logger([$syslogTarget]);