1. Go to this page and download the library: Download everon/logger-gelf 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/ */
use Everon\Shared\Logger\Configurator\Plugin\LoggerConfigurator;
use Everon\Logger\EveronLoggerFacade;
use Everon\Shared\LoggerGelf\Configurator\Plugin\GelfHttpLoggerPluginConfigurator;
use Everon\Shared\LoggerGelf\Configurator\Plugin\GelfTcpLoggerPluginConfigurator;
use Everon\Shared\LoggerGelf\Configurator\Plugin\GelfUdpLoggerPluginConfigurator;
use Monolog\Level;
$gelfHttpPluginConfigurator = (new GelfHttpLoggerPluginConfigurator)
->setLogLevel(Level::Debug)
->setHost('graylog.host.http');
$gelfTcpPluginConfigurator = (new GelfTcpLoggerPluginConfigurator)
->setLogLevel(Level::Warning)
->setHost('graylog.host.tcp');
$gelfUdpPluginConfigurator = (new GelfUdpLoggerPluginConfigurator)
->setLogLevel(Level::Info)
->setHost('graylog.host.udp');
$configurator = (new LoggerConfigurator)
->addPluginConfigurator($gelfHttpPluginConfigurator)
->addPluginConfigurator($gelfTcpPluginConfigurator)
->addPluginConfigurator($gelfUdpPluginConfigurator);
$logger = (new EveronLoggerFacade())->buildLogger($configurator);
$logger->info('lorem ipsum');
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.