PHPackages                             monitaroo/monitaroo-symfony - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. monitaroo/monitaroo-symfony

ActiveSymfony-bundle[Logging &amp; Monitoring](/categories/logging)

monitaroo/monitaroo-symfony
===========================

Official Monitaroo Bundle for Symfony - Logs, Metrics &amp; Monitoring

v1.0.2(1mo ago)039—0%MITPHPPHP ^7.2 || ^8.0

Since Mar 12Pushed 1mo agoCompare

[ Source](https://github.com/Monitaroo/monitaroo-symfony)[ Packagist](https://packagist.org/packages/monitaroo/monitaroo-symfony)[ Docs](https://github.com/Monitaroo/monitaroo-symfony)[ RSS](/packages/monitaroo-monitaroo-symfony/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (6)Versions (4)Used By (0)

Monitaroo Symfony Bundle
========================

[](#monitaroo-symfony-bundle)

Official Symfony Bundle for [Monitaroo](https://monitaroo.com) - Logs, Metrics &amp; Monitoring.

[![Latest Version](https://camo.githubusercontent.com/53894a976d3c844c2984aaa9b32bf6275557a4c29f10478c2f94c2a443bb98ea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6f6e697461726f6f2f6d6f6e697461726f6f2d73796d666f6e792e737667)](https://packagist.org/packages/monitaroo/monitaroo-symfony)[![PHP Version](https://camo.githubusercontent.com/043d0778a0b2efa37425334f90e67e7f2abebe95995d45898ebdf2cab07e224f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6d6f6e697461726f6f2f6d6f6e697461726f6f2d73796d666f6e792e737667)](https://packagist.org/packages/monitaroo/monitaroo-symfony)[![Symfony Version](https://camo.githubusercontent.com/bcbdb4b6151076b6afae3c4b8c8363f06e089256e8ae701d787eed4f715f4c3a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73796d666f6e792d322e38253230253743253230332e78253230253743253230342e78253230253743253230352e78253230253743253230362e78253230253743253230372e782d626c75652e737667)](https://packagist.org/packages/monitaroo/monitaroo-symfony)[![License](https://camo.githubusercontent.com/35bc19ee03bd2de8e3b75cd58de480a674c0e53432fa7ff7919ec66efc78baac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6d6f6e697461726f6f2f6d6f6e697461726f6f2d73796d666f6e792e737667)](https://packagist.org/packages/monitaroo/monitaroo-symfony)

Installation
------------

[](#installation)

```
composer require monitaroo/monitaroo-symfony
```

**Requirements:** PHP 7.2+, Symfony 2.8+

Configuration
-------------

[](#configuration)

### Symfony 4+ (Flex)

[](#symfony-4-flex)

Create `config/packages/monitaroo.yaml`:

```
monitaroo:
    api_key: '%env(MONITAROO_API_KEY)%'
```

Add to `.env`:

```
MONITAROO_API_KEY=mk_your_api_key
```

### Symfony 2.8 / 3.x

[](#symfony-28--3x)

Register the bundle in `app/AppKernel.php`:

```
public function registerBundles()
{
    $bundles = [
        // ...
        new Monitaroo\Symfony\MonitarooBundle(),
    ];
}
```

Add configuration in `app/config/config.yml`:

```
monitaroo:
    api_key: '%env(MONITAROO_API_KEY)%'
```

Quick Start
-----------

[](#quick-start)

```
use Monitaroo\Client;

class MyController
{
    private $monitaroo;

    public function __construct(Client $monitaroo)
    {
        $this->monitaroo = $monitaroo;
    }

    public function index()
    {
        // Logging
        $this->monitaroo->info('User logged in', ['user_id' => 123]);
        $this->monitaroo->error('Payment failed', ['order_id' => 456]);

        // Metrics
        $this->monitaroo->increment('orders.completed');
        $this->monitaroo->gauge('queue.size', 42);
        $this->monitaroo->timing('api.response_time', 145.5);

        // Timer helper
        $stop = $this->monitaroo->startTimer('db.query');
        $users = $this->repository->findAll();
        $stop(); // Records the timing
    }
}
```

Using with Monolog
------------------

[](#using-with-monolog)

Add Monitaroo as a Monolog handler in `config/packages/monolog.yaml`:

```
monolog:
    handlers:
        monitaroo:
            type: service
            id: monitaroo.monolog_handler
            level: debug
```

Then use the standard logger:

```
use Psr\Log\LoggerInterface;

class MyService
{
    public function __construct(private LoggerInterface $logger)
    {
    }

    public function doSomething()
    {
        $this->logger->info('Something happened');
    }
}
```

Full Configuration
------------------

[](#full-configuration)

```
monitaroo:
    # Required: Your API key
    api_key: '%env(MONITAROO_API_KEY)%'

    # API endpoint (default: https://api.monitaroo.com)
    endpoint: 'https://api.monitaroo.com'

    # Service name (default: project directory name)
    service: 'my-app'

    # Environment (default: kernel.environment)
    environment: 'production'

    # Host name (auto-detected if not set)
    host: 'server-01'

    # Batch size before auto-flush (default: 100)
    batch_size: 100

    # Auto-flush on kernel.terminate (default: true)
    auto_flush: true
```

Logging
-------

[](#logging)

### Log Levels

[](#log-levels)

```
$monitaroo->trace('Detailed trace');
$monitaroo->debug('Debug info');
$monitaroo->info('General info');
$monitaroo->warn('Warning');
$monitaroo->error('Error occurred');
$monitaroo->fatal('Fatal error');
```

### Context &amp; Tags

[](#context--tags)

```
// Context becomes searchable attributes
$monitaroo->info('Order placed', [
    'order_id' => 123,
    'amount' => 99.99,
]);

// Tags are indexed for fast filtering
$monitaroo->info('Order placed', [
    'order_id' => 123,
    'tags' => [
        'type' => 'order',
        'country' => 'FR',
    ],
]);
```

### Exception Logging

[](#exception-logging)

```
try {
    // ...
} catch (\Exception $e) {
    $monitaroo->error('Operation failed', [
        'exception' => $e,
    ]);
}
```

Metrics
-------

[](#metrics)

### Counter

[](#counter)

```
$monitaroo->increment('api.requests');
$monitaroo->increment('items.sold', 5);
$monitaroo->increment('api.requests', 1, ['endpoint' => '/users']);
```

### Gauge

[](#gauge)

```
$monitaroo->gauge('queue.size', $queueSize);
$monitaroo->gauge('memory.mb', memory_get_usage(true) / 1024 / 1024);
```

### Timer

[](#timer)

```
// Manual
$start = microtime(true);
$result = $this->doSomething();
$monitaroo->timing('operation.duration', (microtime(true) - $start) * 1000);

// Using helper
$stop = $monitaroo->startTimer('db.query', ['table' => 'users']);
$users = $repository->findAll();
$stop();
```

### Histogram

[](#histogram)

```
$monitaroo->histogram('order.amount', $order->getTotal());
```

Auto-Flush
----------

[](#auto-flush)

Logs and metrics are automatically flushed on `kernel.terminate` event, after the response is sent to the client.

To disable auto-flush:

```
monitaroo:
    auto_flush: false
```

Then manually flush:

```
$monitaroo->flush();
```

Console Commands
----------------

[](#console-commands)

For console commands, logs are flushed when the command finishes (via shutdown handler).

For long-running commands, call `flush()` periodically:

```
while ($processing) {
    // ... process items
    $monitaroo->flush();
}
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance88

Actively maintained with recent releases

Popularity11

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

58d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/00d4e26523d2e5c8cc70b00b5dbfbe0dd4c51b9881d9bcd6d230856c26873549?d=identicon)[anivon](/maintainers/anivon)

---

Top Contributors

[![anivon](https://avatars.githubusercontent.com/u/4992953?v=4)](https://github.com/anivon "anivon (1 commits)")

---

Tags

symfonybundleloggingmonitoringMetricsobservabilitymonitaroo

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/monitaroo-monitaroo-symfony/health.svg)

```
[![Health](https://phpackages.com/badges/monitaroo-monitaroo-symfony/health.svg)](https://phpackages.com/packages/monitaroo-monitaroo-symfony)
```

###  Alternatives

[friendsofopentelemetry/opentelemetry-bundle

Traces, metrics, and logs instrumentation within your Symfony application

638.6k](/packages/friendsofopentelemetry-opentelemetry-bundle)[inspector-apm/inspector-symfony

Code Execution Monitoring for Symfony applications.

2830.1k2](/packages/inspector-apm-inspector-symfony)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
