# How we can write plugin error logs?

**URL:** <https://forum.shopware.com/t/how-we-can-write-plugin-error-logs/60498>\
**Category:** Plugins\
**Created:** [18. Juli 2019 um 07:20 UTC](https://forum.shopware.com/t/how-we-can-write-plugin-error-logs/60498 "2019-07-18T07:20:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abinjohnedamana](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/abinjohnedamana/32/17378_2.png) [@abinjohnedamana](https://forum.shopware.com/u/abinjohnedamana)\
**Post date:** [18. Juli 2019 um 07:20 UTC](https://forum.shopware.com/t/how-we-can-write-plugin-error-logs/60498/1 "2019-07-18T07:20:38Z")

</div>

I read the following from

“The error messages and hints of the plugin may only be written to the plugin-log in the log folder of Shopware ( /var/log/ ). The method $logger must be used for this. Never write plugin exceptions into the Shopware core.log or outside the Shopware log folder. This ensures that the log file can never be accessed via URL”

[https://docs.shopware.com/en/plugin-standard-for-community-store](https://docs.shopware.com/en/plugin-standard-for-community-store).

How we can implement this?

Are there any free plugins contains this feature?

Or any Shopware documentation is for this feature?

Please help me.

---

<div class="post-metadata">

**Author:** ![Michael\_Telgmann](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/michael_telgmann/32/20289_2.png) [@Michael\_Telgmann](https://forum.shopware.com/u/Michael_Telgmann)\
**Post date:** [18. Juli 2019 um 08:14 UTC](https://forum.shopware.com/t/how-we-can-write-plugin-error-logs/60498/2 "2019-07-18T08:14:45Z")

</div>

Hey,

there is dedicated logger service for plugins. It’s ID in the DI container is “pluginlogger”. Here is an example:&nbsp;[https://github.com/shopwareLabs/SwagPaymentPayPalUnified/blob/master/Resources/services/services.xml#L119](https://github.com/shopwareLabs/SwagPaymentPayPalUnified/blob/master/Resources/services/services.xml#L119)  
Since Shopware 5.6 you are even able to create your own plugin specific logger:&nbsp;[Shopware 5 upgrade guide](https://developers.shopware.com/developers-guide/shopware-5-upgrade-guide-for-developers/#plugin-specific-logger)

I will adjust the article to make it more clear, what should be used.

Best regards from Schöppingen

![cool](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/1X/86c57fbace799dd4eb1f1b8a2d3bdc1733f0aea1.png "cool")&nbsp;Michael Telgmann
