2

Magento 2.2.5 brings excesive logging to system.log which can grow up to 100 - 150 MB in 1 month.

This will obviously be a problem for many shops.

There is an official response to this on github (https://github.com/magento/magento2/issues/17190) and their "fix" will be introducted in M2.2.8 and M2.3.1, but it really isn't a fix, because it just moves to excesive logging to a different file called cron.log.

Since there is no log "off switch" in admin like there was in M1, I'm wondering if anyone knows of a proper way to disable these logs or to increase the logging level to, for example, warning level.

The only solution which comes to mind, without dwelling deeper into Magento's logging functionality, is to (ironically) create a cron job to delete the excesive cron logging... which is obviously silly.

  • 1
    That's exactly what I've done. Silly me! – PedroKTFC Jun 18 '19 at 16:39
2

Yes it does seem a bit strange that Magento don't document away around this. We actually hit the same issue. We have developed a module that can be installed by running:
composer require zero1/module-custom-logging
The docs can be seen here.

This allows you to change the logging level on a per environment basis. We use "production" in production :p and "non_production" on Mdoq.

Hope this helps

  • I checked the docs on github, but they don't really show what "production" and "non_production" environment values really do. Personally, I don't have extensive knowledge how Magento's core logging works and the docs seem to be aimed at people who do. Would you be inclined to provide additional info on what these settings actually do? – Lez Jun 28 '19 at 9:46
  • Hi Lez, I've updated the docs here could you have a look and let me know if this helps. If not I can explain a bit more :) – Adam Jul 3 '19 at 11:24

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.