PHPackages                             adrenalinkin/monolog-autowire-bundle - 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. adrenalinkin/monolog-autowire-bundle

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

adrenalinkin/monolog-autowire-bundle
====================================

Provides autowiring for the loggers registered by symfony/monolog-bundle

v2.1.0(7y ago)328MITPHPPHP ~7.1

Since Apr 14Pushed 7y ago1 watchersCompare

[ Source](https://github.com/adrenalinkin/monolog-autowire-bundle)[ Packagist](https://packagist.org/packages/adrenalinkin/monolog-autowire-bundle)[ RSS](/packages/adrenalinkin-monolog-autowire-bundle/feed)WikiDiscussions master Synced yesterday

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

Monolog Autowire Bundle [![На Русском](https://camo.githubusercontent.com/feb4c9ee227a5ee3a5d4e83a8a5b888b2e4b666d6cc2fb985c3bf404f8f271ac/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2544302539462544302542352544312538302544302542352544302542392544312538322544302542385f2544302542442544302542302d2544302541302544312538332544312538312544312538312544302542412544302542382544302542392d677265656e2e7376673f7374796c653d666c61742d737175617265)](./README.RU.md)
===================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#monolog-autowire-bundle-)

[![Latest Stable Version](https://camo.githubusercontent.com/b25e91b49acc48e5300af6b0b51551d1dd8e903c4f4595a0196f95960d54cc5b/68747470733a2f2f706f7365722e707567782e6f72672f616472656e616c696e6b696e2f6d6f6e6f6c6f672d6175746f776972652d62756e646c652f762f737461626c65)](https://packagist.org/packages/adrenalinkin/monolog-autowire-bundle)[![Total Downloads](https://camo.githubusercontent.com/6af82496511f69e1c7cfca6bb34a37a7f5e9592c4c24d6ccda1862aacb8d69b5/68747470733a2f2f706f7365722e707567782e6f72672f616472656e616c696e6b696e2f6d6f6e6f6c6f672d6175746f776972652d62756e646c652f646f776e6c6f616473)](https://packagist.org/packages/adrenalinkin/monolog-autowire-bundle)

[![knpbundles.com](https://camo.githubusercontent.com/ebdd4d00c1ccb61db7d4c07fd4ea3cdb204a2f996a1114cdc20966a838680a21/687474703a2f2f6b6e7062756e646c65732e636f6d2f616472656e616c696e6b696e2f6d6f6e6f6c6f672d6175746f776972652d62756e646c652f62616467652d73686f7274)](http://knpbundles.com/adrenalinkin/monolog-autowire-bundle)

Introduction
------------

[](#introduction)

Bundle provides the ability to connect loggers registered in `MonologBundle` through the standard `autowire` mechanism. The goal is achieved thanks to auto-generated classes of loggers. Each class decorates one object of one of the registered `monolog` channel.

Also available is the second way to achieve the goal - using the `LoggerCollection`. If the requested channel does not exist - will be selected fallback `logger`. As fallback `logger` will be used service, which referenced by `@Psr\Log\LoggerInterface`. In that case where `logger` was not registered in service container will be returned instance of `Psr\Log\NullLogger`.

**Important:** Bundle will work properly in the absence of `MonologBundle` in the project. In that case `LoggerCollection` will always return a fallback value.

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

[](#installation)

### Step 1: Download the Bundle

[](#step-1-download-the-bundle)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
    composer require adrenalinkin/monolog-autowire-bundle
```

*is command requires you to have [Composer](https://getcomposer.org) install globally.*

### Step 2: Enable the Bundle

[](#step-2-enable-the-bundle)

Then, enable the bundle by updating your `app/AppKernel.php` file to enable the bundle:

```
