Raised: $0
0% of monthly goal Help us cross the finish line!
Goal: $12,000
Raised: $0 Goal: $12,000
0% of monthly goal Help us cross the finish line!
Sponsor DDEV

add-on registry tests last commit release

DDEV Buggregator

Overview

This add-on integrates Buggregator into your DDEV project. Buggregator is a powerful debugging server that helps with application debugging and monitoring by collecting logs, profiling data, and other debugging information.

Installation

ddev add-on get iljapolanskis/ddev-buggregator
ddev restart

After installation, make sure to commit the .ddev directory to version control.

Usage

Command Description
ddev describe View service status and used ports for Buggregator
ddev logs -s buggregator Check Buggregator logs

Accessing Buggregator UI

Open https://mysite.ddev.site:8000 in your browser to access the Buggregator web interface.

Additional information on using Buggregator can be found in the Buggregator documentation.

Configuration

You can customize the Buggregator service by setting environment variables in your .ddev/.env file:

# Buggregator image version
BUGGREGATOR_IMAGE=ghcr.io/buggregator/server:latest

# Port configurations
BUGGREGATOR_HTTP_PORT=8000
BUGGREGATOR_SMTP_PORT=1025
BUGGREGATOR_VAR_DUMPER_PORT=9912
BUGGREGATOR_MONOLOG_PORT=9913
BUGGREGATOR_SENTRY_PORT=9511
BUGGREGATOR_RAY_PORT=23517

After making changes, restart DDEV:

ddev restart

Configuration Options

Variable Default Description
BUGGREGATOR_IMAGE ghcr.io/buggregator/server:latest Docker image version to use
BUGGREGATOR_HTTP_PORT 8000 HTTP port for web interface
BUGGREGATOR_SMTP_PORT 1025 SMTP port for email debugging
BUGGREGATOR_VAR_DUMPER_PORT 9912 Port for Symfony VarDumper
BUGGREGATOR_MONOLOG_PORT 9913 Port for Monolog handler
BUGGREGATOR_SENTRY_PORT 9511 Port for Sentry integration
BUGGREGATOR_RAY_PORT 23517 Port for Ray debugging tool

PHP Usage Example

Here’s an example of how to send logs to Buggregator from within your PHP application:

First, install the required PHP library:

composer require monolog/monolog

Then use it in your code (playground.php file):

<?php

require_once 'vendor/autoload.php';

use Monolog\Logger;
use Monolog\Handler\SocketHandler;
use Monolog\Formatter\JsonFormatter;

// Create a log channel
$logger = new Logger('myapp');

// Create socket handler for Buggregator
$handler = new SocketHandler('buggregator:9913');
$handler->setFormatter(new JsonFormatter());
$logger->pushHandler($handler);

// Send different log levels to Buggregator
$logger->info('Application started');
$logger->warning('This is a warning message');
$logger->error('An error occurred', ['user_id' => 123, 'action' => 'login']);
$logger->debug('Debug information', ['query' => 'SELECT * FROM users']);

Note: This example uses the default Buggregator service hostname (buggregator) which is accessible from within the DDEV environment.

ddev exec php playground.php

Credits

Contributed and maintained by @iljapolanskis

This add-on uses the Buggregator Server Docker image as the base for the debugging service.