Skip to content

Instantly share code, notes, and snippets.

@martinboy
Created September 10, 2018 11:47
Show Gist options
  • Save martinboy/3999fb5efe12bf4484ea1a0f6d404da3 to your computer and use it in GitHub Desktop.
Save martinboy/3999fb5efe12bf4484ea1a0f6d404da3 to your computer and use it in GitHub Desktop.
Magenta 2 snippets: Custom debug log file
<virtualType name="VirtualDebug" type="Magento\Framework\Logger\Handler\Base">
<arguments>
<argument name="fileName" xsi:type="string">/var/log/custom_error.log</argument>
</arguments>
</virtualType>
<virtualType name="VirtualLogger" type="Magento\Framework\Logger\Monolog">
<arguments>
<argument name="handlers" xsi:type="array">
<item name="debug" xsi:type="object">VirtualDebug</item>
</argument>
</arguments>
</virtualType>
<type name="Vendor\Model\Model\Log">
<arguments>
<argument name="logger" xsi:type="object">VirtualLogger</argument>
</arguments>
</type>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment