Magento2: system.log rapidly increasing after Magento CE 2.2.5 update (cron logs)

Created on 27 Jul 2018  路  7Comments  路  Source: magento/magento2

system.log is increasing rapidly after Magento CE 2.2.5 update with the added cron info logs.
Cronjob is runs every minute, so after one day i have about 5MB system.log size. This seems a little too much.

The logging is not bad, but in Production mode several logs every minute, that the cronjob has run successful seems a bit unnecessary.

A solution could be to make Loglevel of system.log configurable or change the log-level from info to debug.

Related:
https://github.com/magento/magento2/blob/2.2.5/app/code/Magento/Cron/Observer/ProcessCronQueueObserver.php#L313

system.log:

[2018-07-27 10:43:02] main.INFO: Cron Job catalog_product_outdated_price_values_cleanup is run [] []
[2018-07-27 10:43:02] main.INFO: Cron Job catalog_product_outdated_price_values_cleanup is successfully finished. Statistics: {"sum":0.10062503814697,"count":1,"realmem":0,"emalloc":3162464,"realmem_start":52428800,"emalloc_start":140877
52} [] []

[... (more cron job lines) ...]

[2018-07-27 10:44:02] main.INFO: Cron Job catalog_product_frontend_actions_flush is run [] []
[2018-07-27 10:44:02] main.INFO: Cron Job catalog_product_frontend_actions_flush is successfully finished. Statistics: {"sum":0.00043821334838867,"count":1,"realmem":0,"emalloc":752,"realmem_start":52428800,"emalloc_start":17237376} [] [
]

Preconditions

  1. Magento CE 2.2.5

Steps to reproduce

  1. Install Magento
  2. Setup Cron-Jobs (bin/magento cron:setup)
  3. Set deploy mode to production

Expected result

  1. Get a usable system.log

Actual result

  1. After one day, the system.log has already several MB filesize.
Fixed in 2.2.x Fixed in 2.3.x Format is valid non-issue

Most helpful comment

I agree with @mad-develop that this behavior is very annoying to say the least.
But @engcom-backlog-pb is also correct in that it is strictly not a bug. It would however be nicer if some extra context was given instead of a measly 5 word reply.

Anyway, since this is not strictly a bug, we can consider it as a feature request, so @mad-develop, if you want you can open a feature request over here to improve this functionality: https://github.com/magento/community-features/issues or send in a PR to this repo with suggested improvements.

All 7 comments

Hi @mad-develop. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting from 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation.

@mad-develop do you confirm that you was able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

@mad-develop, this is not a bug.

@engcom-backlog-pb
yeah its not a bug, but definitly needs improvement.
after a month, the log would have >150MB only with successful cron logs...

I don't know how long your shops are running, but these logs in production mode seems excessive. And there are separate log files that are empty and never gets filled (magento.cron.log, update.cron ...)

Seems i have to write my own system logger to avoid this "feature". But its a ugly solution, just because there is no configuration possible for system logging.

Now I'm sad. :(

I agree with @mad-develop that this behavior is very annoying to say the least.
But @engcom-backlog-pb is also correct in that it is strictly not a bug. It would however be nicer if some extra context was given instead of a measly 5 word reply.

Anyway, since this is not strictly a bug, we can consider it as a feature request, so @mad-develop, if you want you can open a feature request over here to improve this functionality: https://github.com/magento/community-features/issues or send in a PR to this repo with suggested improvements.

Thanks @hostep for your help. I've seen there is already a pull request for logging configuration #12349.
Maybe my problems will be solved in the near future.

Hi @mad-develop. Thank you for your report.
The issue has been fixed in magento/magento2#18209 by @hostep in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

Hi @mad-develop. Thank you for your report.
The issue has been fixed in magento/magento2#18389 by @hostep in 2.2-develop branch
Related commit(s):

The fix will be available with the upcoming 2.2.8 release.

Was this page helpful?
0 / 5 - 0 ratings