sendsmaily / smaily-magento-extension

Smaily extension for Magento 2.3 and newer
GNU General Public License v3.0
0 stars 3 forks source link

Extensive logging may lead to large log files on customer server #113

Open sinukaarel opened 1 month ago

sinukaarel commented 1 month ago

I have received a smly_cart_cron.log from a client. The first date is 2024-07-19 and the latest is 2024-10-23 - 96 days ~ 3 months. This log is 30MB large. So it generates ~10MB of logs per month, 5 years would generate ~ 600MB large log file.

We might want to reduce the log noise by removing entries such as:

[2024-07-19T11:33:10.371093+00:00] main.INFO: Starting Abandoned Cart CRON job... [] []
[2024-07-19T11:33:10.374974+00:00] main.DEBUG: CRON is disabled for website: {"id":"6","name":"***","code":"***"} []
...
[2024-07-19T11:33:10.390527+00:00] main.INFO: Finished Abandoned Cart CRON job [] []

and include a year/month in the log file name to periodically generate new files so they don't grow too large and are parsable.

There might be some other options that I can't think of currently.

kaittodesk commented 1 month ago

I think log rotation shouldn't be part of the plugin and should be handled by creating a logrotate.d (or similar) configuration.

An alternative solution would be to remove our own log files and start logging CRON job output to Magento's log files. This would also cover cases where log rotation is only configured for Magento's core log files.