0
Magento 2.4.2-p1
Smartwave Porto theme
Amasty extensions

I have many Errors in my log files in:

/public_html/var/log

Some of these log files are getting quite large so I thought if I rename them, the system would just generate a new file?

I would also want to do this after correcting something such as today, I found an Error in the exception.log file saying our Paypal merchant address does not match.

I've corrected it in the PayPal Payments Pro setting in the Admin panel, then renamed exception.log to exception_December_16th_2021.log, cleared Cache, and reindexed, and was expecting the file to be recreated but that hasn't happened!

What is the best way to manage the log files?

Would the ideal state of things be that there would be no Errors generated in any of these files?

enter image description here

2
  • Do you want to delete these files auto in x days?
    – Arunendra
    Commented Dec 17, 2021 at 7:06
  • To manage logs I would suggest using logrotate if you are in a linux environment. It can for example compress your log file and rename it then create a new one everyday and then delete all log files older than 30 days. Commented Dec 17, 2021 at 21:30

2 Answers 2

0

You need to understand this things.

  1. /public_html/var/log this is standard directory where every log file is generated, so if you talking about place then this is proper places for all log files.

  2. The different log files is generated for different actions or event happen into the magento like cron etc.

  3. The Best way to manage this is, resolve the error which mention into this log files, so that can't generated log files.

0

The best way to manage your logs is to delete all data from file and resolve your issue so that next time this will not happen to your logs

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.