PHPackages                             idct/symfony-async-monolog-handler - 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. idct/symfony-async-monolog-handler

ActiveLibrary

idct/symfony-async-monolog-handler
==================================

Simple toolchain for Symfony 6+ framework and Monolog which allows sending logs using the symfony/messenger asynchronously.

0.1(1y ago)0720MITPHP

Since Sep 26Pushed 1y ago2 watchersCompare

[ Source](https://github.com/ideaconnect/symfony-async-monolog-handler)[ Packagist](https://packagist.org/packages/idct/symfony-async-monolog-handler)[ RSS](/packages/idct-symfony-async-monolog-handler/feed)WikiDiscussions main Synced 1mo ago

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

idct/symfony-async-monolog-handler
==================================

[](#idctsymfony-async-monolog-handler)

Simple toolchain for Symfony 6+ framework and Monolog which allows sending logs using the symfony/messenger asynchronously.

Installation
============

[](#installation)

```
composer require idct/symfony-async-monolog-handler

```

Usage
=====

[](#usage)

As this is not a bundle, but a library which acts as a toolchain you need to execute three steps before it actually works:

1. Register the service in your `services.yaml`:

```
    monolog.handler.async-stream:
        class: IDCT\Logger\Monolog\Handler\AsyncMessageHandler
        public: false
```

2. Choose which real handler should be actually executed. For example if you have:

```
    file_log:
        type: stream
        # log to var/log/(environment).log
        path: "%kernel.logs_dir%/async-test.log"
        # log *all* messages (debug is lowest level)
        level: debug
```

in your `monolog.yaml` then add to `services.yaml`:

```
    IDCT\Logger\Messenger\AsyncLogMessageHandler:
        arguments:
            - '@monolog.handler.file_log'
```

3. Add you asynchronous channel, for example name it `async`, then to `monolog.yaml` add:

```
monolog:
    channels:
        - async
```

4. In `monolog.yaml` register your async proxy logger:

```
    async-stream:
        type: 'service'
        id: 'monolog.handler.async-stream'
        channels: ['async']
        level: debug
```

where `id` must match the identifier of a service from step 1.

5. Whenever you want to use your async logger inject it using standard symfony + monolog naming convention which include channel's name:

```
    public function __construct(protected LoggerInterface $asyncLogger)
    {

    }
```

6. Register a transport for your async messages in `messenger.yaml`:

```
framework:
    messenger:
        transports:
            async: '%env(MESSENGER_TRANSPORT_DSN)%'

        routing:
            # Route your messages to the transports
            'IDCT\Logger\Model\AsyncLogMessage': async
```

7. Be sure to set `MESSENGER_TRANSPORT_DSN` env variable.
8. Activate symfony/messenger.
9. Note: Target handler will handle the message even if its channels' list does not match. This can be useful to filter out other messages, for example the target handler may be set to ignore messenger logs:

```
    file_log:
        type: stream
        # log to var/log/(environment).log
        path: "%kernel.logs_dir%/async-test.log"
        # log *all* messages (debug is lowest level)
        channels: ['!messenger']
        level: debug
```

Contribution
============

[](#contribution)

Any contribution towards better testing is more than welcome. In `tests/func` you can already find a preconfigured symfony which tests the solution when `app:test` (TestCommand.php) is executed.

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance38

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity28

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

590d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b76a5fac115d24d698d09cc939a6922bf309732ae61d0f2f215ae9e7397658ea?d=identicon)[ideaconnect](/maintainers/ideaconnect)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/idct-symfony-async-monolog-handler/health.svg)

```
[![Health](https://phpackages.com/badges/idct-symfony-async-monolog-handler/health.svg)](https://phpackages.com/packages/idct-symfony-async-monolog-handler)
```

###  Alternatives

[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M647](/packages/sylius-sylius)[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k348.9M2.5k](/packages/symfony-cache)[symfony/mailer

Helps sending emails

1.6k368.1M950](/packages/symfony-mailer)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M151](/packages/sulu-sulu)[contao/core-bundle

Contao Open Source CMS

1231.6M2.3k](/packages/contao-core-bundle)

PHPackages © 2026

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