1. Go to this page and download the library: Download yiisoft/log 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 example snippets
/**
* List of class instances that extend the \Yiisoft\Log\Target abstract class.
*
* @var \Yiisoft\Log\Target[] $targets
*/
$logger = new \Yiisoft\Log\Logger($targets);
$logger->setFlushInterval(100); // default is 1000
$target->setExportInterval(100); // default is 1000
$logger = new \Yiisoft\Log\Logger(contextProvider: $myContextProvider);
$logger = new \Yiisoft\Log\Logger(
contextProvider: new Yiisoft\Log\ContextProvider\SystemContextProvider(
traceLevel: 3,
excludedTracePaths: [
'/vendor/yiisoft/di',
],
),
);
$logger = new \Yiisoft\Log\Logger(
contextProvider: new Yiisoft\Log\ContextProvider\CommonContextProvider([
'environment' => 'production',
]),
);
$logger = new \Yiisoft\Log\Logger(
contextProvider: new Yiisoft\Log\ContextProvider\CompositeContextProvider(
new Yiisoft\Log\ContextProvider\SystemContextProvider(),
new Yiisoft\Log\ContextProvider\CommonContextProvider(['environment' => 'production'])
),
);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.