6

My logs are being flooded with cron jobs updates. How can I disable this?

[2019-02-27 06:28:02] main.INFO: Cron Job outdated_authentication_failures_cleanup is run [] []
[2019-02-27 06:28:02] main.INFO: Cron Job outdated_authentication_failures_cleanup is successfully finished. Statistics: {"sum":0.00048398971557617,"count":1,"realmem":0,"emalloc":1128,"realmem_start":138412032,"emalloc_start":136589928} [] []
[2019-02-27 06:28:03] main.INFO: Cron Job magento_newrelicreporting_cron is run [] []
[2019-02-27 06:28:03] main.INFO: Cron Job magento_newrelicreporting_cron is successfully finished. Statistics: {"sum":0.0003509521484375,"count":1,"realmem":0,"emalloc":752,"realmem_start":140509184,"emalloc_start":137617904} [] []
[2019-02-27 06:28:03] main.INFO: Cron Job indexer_reindex_all_invalid is run [] []
[2019-02-27 06:28:03] main.INFO: Cron Job indexer_reindex_all_invalid is successfully finished. Statistics: {"sum":0.0062119960784912,"count":1,"realmem":0,"emalloc":551552,"realmem_start":134217728,"emalloc_start":121324440} [] []
[2019-02-27 06:28:03] main.INFO: Cron Job indexer_update_all_views is run [] []

And so on ....

I found this in official docs: https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html

However, it doesn't say how to disable the logs...

I want to disable the logs for cron only. How can I achieve this? Is there a admin config or I have to do it manually?

3
  • 1
    In the end I've added a task to cron to delete the file. I do it less frequently than the Magento cron so I can see some output if I need to.
    – PedroKTFC
    Jun 18, 2019 at 16:38
  • May I ask how you added that task to delete the cron.log? It's making me crazy. thanks!
    – gretch
    Jun 26, 2019 at 20:35
  • Had same problem, wrote module that redirects cron log into separate file. magento2-cronlogger
    – MAX
    Nov 22, 2023 at 19:24

2 Answers 2

3

Sorry, not enough of reputation.

You could also enable log rotation on that folder. If your server is running ubuntu or anything debian like just do the following:

# touch /etc/logrotate.d/magento2

with following contents

/var/www/website.com/httpdocs/var/log/*.log {
    daily
    missingok
    rotate 14
    compress
    delaycompress
    notifempty
    su www-user www-data
    create 0664 www-user www-data
}
0

Another solution would be to make cron log file read only. Not a great solution but same as having a cron log cleaning process in place in my opinion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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