PHP code example of xervice / logger
1. Go to this page and download the library: Download xervice/logger 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/ */
xervice / logger example snippets
use App\Logger\LoggerConfig;
$config[LoggerConfig::LOG_FILENAME] = 'xervice.log';
$config[LoggerConfig::LOG_PATH] = dirname(__DIR__) . '/logs';
namespace App\Logger;
use Xervice\Logger\Communication\Plugin\FileHandler\FileLogHandler;
use Xervice\Logger\LoggerDependencyProvider as XerviceLoggerDependencyProvider;
class LoggerDependencyProvider extends XerviceLoggerDependencyProvider
{
/**
* @return array
*/
protected function getLogHandler(): array
{
return [
new FileLogHandler()
];
}
}