1

I have Magento 2.2.x and system.log grows each minute, because of entries like:

[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Customer::customer_manage was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Customer::customer_online was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Customer::customer_group was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_AdminNotification::system_adminnotification was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Config::system_config was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Indexer::system_index was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Cms::cms_page was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Cms::cms_block was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Catalog::catalog was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Catalog::catalog_products was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Catalog::catalog_categories was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Catalog::catalog_attributes_attributes was processed [] []
[2018-09-30 17:53:15] main.INFO: Add of item with id Magento_Catalog::catalog_attributes_sets was processed [] []

How can I stop Magento logging such info?

0

unfortunately this direct settings are not avaliable in magento2 to disable syetem log, please check this file and comment code, it may help you

vender\Magento\Framework\Logger\Handler\System.php when you use the system level, logs will got to /var/log/system.log

Thanks, Hope it may help you.

3
  • thanks! but after next update of magento this will be overwritten, right?
    – matin
    Oct 1 '18 at 11:11
  • yes you have to make a plugin for this file
    – Divyesh
    Oct 1 '18 at 11:13
  • @Divyesh if you dont want to make plugin then you can override that file just copy that file and paste in below folder. "lib/internal/Magento/Framework/Logger/Handler/System.php" Jan 29 '20 at 6:46
0

Magento mode:

see this file vendor/magento/module-backend/Model/Menu.php

  • create a new module
  • create a system.xml file with a configuration system.log enable/disable crop useless logs
  • create a model/config.php file with the method that get the value from system.xml
  • create a plugin around for this function vendor/magento/module-backend/Model/Menu.php::add
  • inject config.php file custom and create an if that based on value print the log
  • easy

Brutality

  • cron that every minute remove the file with absolute path:

* * * * * find /magento/path/var/log/system.log -mtime +7 -exec rm -f {} \;

  • or maybe a cron that every minute set file as empty, or something like this:

* * * * * find /magento/path/var/log/system.log -mtime +7 -exec {} > true \;

Cheers

-2

In magento2 this option is not exist,the setting has been removed from admin area.

if you don't want system.log then run below command

rm -rf var/log/system.log
3
  • thanks. but after deleting file, file is generateed again automatically ....
    – matin
    Oct 1 '18 at 11:10
  • i know but this the best thing we can do.otherwise magento 2 have not disbale functionality of system.log. Oct 1 '18 at 11:13
  • This will not "stop Magento logging such info" (quoting the original question). Sep 17 '19 at 9:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.