This repository implements Buggregator as a DDEV add-on service.
Can be installed from the command line.
For DDEV v1.23.5 or above run
ddev add-on get iljapolanskis/ddev-buggregator
For earlier versions of DDEV run
ddev get iljapolanskis/ddev-buggregator
Open the mysite.ddev.site:8000
to see the Buggregator UI. Additional info on how to use Buggregator can be found in the Buggregator documentation
At the moment I tested the monolog
only (used in Magento 2 by default). Snippet on how to use it in a single file in Magento 2:
<?php
require __DIR__ . '/../app/bootstrap.php';
use Monolog\Logger;
use Monolog\Handler\SocketHandler;
use Monolog\Formatter\JsonFormatter;
// Create a log channel
$log = new Logger('buggregator'); // Any name you want
$handler = new SocketHandler('buggregator:9913'); // The name of the service and the port, by default 9913 for monolog
$handler->setFormatter(new JsonFormatter());
$log->pushHandler($handler);
// Send records to the Buggregator
$log->warning(print_r($handler, true));
======== Inside Magento2 ======
// Create a log channel
$log = new \Monolog\Logger('buggregator'); // Any name you want
$handler = new \Monolog\Handler\SocketHandler('buggregator:9913'); // The name of the service and the port, by default 9913 for monolog
$handler->setFormatter(new \Monolog\Formatter\JsonFormatter());
$log->pushHandler($handler);
// Send records to the Buggregator
$log->warning(print_r($handler, true));