Skip to content

Commit a4f58c8

Browse files
committed
Introducing a dedicated cron.log file for logging cron related info, this reduces output in the system.log file.
1 parent 8fd89cf commit a4f58c8

File tree

1 file changed

+13
-0
lines changed
  • app/code/Magento/Cron/etc

1 file changed

+13
-0
lines changed

app/code/Magento/Cron/etc/di.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@
1616
<type name="Magento\Framework\App\Config\Initial\Converter">
1717
<plugin name="cron_system_config_initial_converter_plugin" type="Magento\Cron\Model\System\Config\Initial\Converter" />
1818
</type>
19+
<virtualType name="Magento\Cron\Model\VirtualLoggerHandler" type="Magento\Framework\Logger\Handler\Base">
20+
<arguments>
21+
<argument name="fileName" xsi:type="string">/var/log/cron.log</argument>
22+
</arguments>
23+
</virtualType>
24+
<virtualType name="Magento\Cron\Model\VirtualLogger" type="Magento\Framework\Logger\Monolog">
25+
<arguments>
26+
<argument name="handlers" xsi:type="array">
27+
<item name="system" xsi:type="object">Magento\Cron\Model\VirtualLoggerHandler</item>
28+
</argument>
29+
</arguments>
30+
</virtualType>
1931
<!-- @api -->
2032
<virtualType name="shellBackground" type="Magento\Framework\Shell">
2133
<arguments>
@@ -25,6 +37,7 @@
2537
<type name="Magento\Cron\Observer\ProcessCronQueueObserver">
2638
<arguments>
2739
<argument name="shell" xsi:type="object">shellBackground</argument>
40+
<argument name="logger" xsi:type="object">Magento\Cron\Model\VirtualLogger</argument>
2841
</arguments>
2942
</type>
3043
<type name="Magento\Framework\Console\CommandListInterface">

0 commit comments

Comments
 (0)