1. Go to this page and download the library: Download lukam/logging-tap 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/ */
namespace App\Logging;
use Monolog\Processor\UidProcessor;
class PushProcessor
{
public function __invoke($logger, $arguments)
{
$logger->getMonolog()->pushProcessor(new UidProcessor);
}
}
namespace App\Logging;
use Monolog\Formatter\LineFormatter;
class Formatter
{
public function __invoke($logger, $arguments)
{
$format = "[%datetime%] - [%level_name%]: %message% %context% %extra%\n";
$formatter = new LineFormatter($format, null, true, true);
foreach ($logger->getHandlers() as $handler) {
$handler->setFormatter($formatter);
}
}
php artisan make:tap ExampleTap
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.