# Plugin-Logger für SW 6

**URL:** <https://forum.shopware.com/t/plugin-logger-fur-sw-6/63963>\
**Category:** Programmierung\
**Created:** [13. Januar 2020 um 09:37 UTC](https://forum.shopware.com/t/plugin-logger-fur-sw-6/63963 "2020-01-13T09:37:50Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![Moorleiche](https://avatars.discourse-cdn.com/v4/letter/m/6f9a4e/32.png) [@Moorleiche](https://forum.shopware.com/u/Moorleiche)\
**Post date:** [16. September 2024 um 10:57 UTC](https://forum.shopware.com/t/plugin-logger-fur-sw-6/63963/9 "2024-09-16T10:57:22Z")

</div>

Ich habe im Slack mal diesen Tipp bekommen. In der offiziellen Shopware Doku ist das sehr umständlich gelöst, man kann aber einen eigenen Service für „LoggerInterface“ registrieren.

```auto
<?xml version="1.0" encoding="UTF-8" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:monolog="http://symfony.com/schema/dic/monolog">
    <monolog:config>
        <monolog:channel>moorl_staging_channel</monolog:channel>
        <monolog:handler name="moorlStagingLogHandler"
                         type="rotating_file"
                         level="debug"
                         path="%kernel.logs_dir%/moorl_staging_%kernel.environment%.log">
            <monolog:channels>
                <monolog:channel>moorl_staging_channel</monolog:channel>
            </monolog:channels>
        </monolog:handler>
    </monolog:config>
</container>

```

Das Level ist hier statisch hinterlegt und steht auf „debug“ es wird also alles geloggt, unabhängig ob „prod“ oder „dev“.

In diesem Beispiel ist der Service, der als LoggerInterface dient:

```auto
<argument type="service" id="monolog.logger.moorl_staging_channel"/>

```

---

_[View the full topic](https://forum.shopware.com/t/plugin-logger-fur-sw-6/63963)._
