Log rotation

VVT

Active Member
Hi @twisted1919 ,

First off, https://forum.mailwizz.com/threads/the-performance-flags.1652/ is an awesome post ! It really solved my woes about email blacklisting :)

There are a few logs - Campaign delivery log, Campaign bounce logs and Delivery server usage logs.There's no option to delete these logs. They're eating up space. So,

Q1. Can I rotate these logs so that it will be deleted after x number of days like the blacklists ?
Q2. Is there a way to delete the existing logs ?

I know I can disable delivery server usage logs completely, but am looking for an option to rotate it.
 

twisted1919

Administrator
Staff member
@VVT - Campaign delivery log, Campaign bounce logs -- Problem with these is that people tend to want to export them for each campaign and this is why we have to store them. If we could discard these logs, the application speed would improve in order of magnitude, but how to do this when people still expect them for export? Do you thing keeping them for a month for example is an option? Then after a month to remove them and replce them with static stats that can't be downloaded?

Delivery server usage logs that are older than one year, are deleted automatically :D too much 1 year?
 

VVT

Active Member
@VVT - Campaign delivery log, Campaign bounce logs -- Problem with these is that people tend to want to export them for each campaign and this is why we have to store them. If we could discard these logs, the application speed would improve in order of magnitude, but how to do this when people still expect them for export? Do you thing keeping them for a month for example is an option? Then after a month to remove them and replce them with static stats that can't be downloaded?

First off, I don't see a download/export option for these logs - they're just statically displayed :). Let's keep it for say a month or so and new logs will flush out the old logs - like the "logrotate" utility in linux. It's even good if that's a configurable time unit like the option we have for blacklists (see attached). So if some people want to keep it for longer period, they can.

@VVT -
Delivery server usage logs that are older than one year, are deleted automatically :D too much 1 year?

I feel so :D. Because counting all these 3 logs, I have more than 2 Million records for a single customer at the end of 6th month. It looks like an unnecessary overload to me :(.
 

Attachments

  • upload_2016-3-11_20-35-49.png
    upload_2016-3-11_20-35-49.png
    14.4 KB · Views: 15

VVT

Active Member
But I think my understanding about the "Blacklisted days" for subscribers is not correct. What's it actually ? Is it the number of days after that a blacklisted subscriber is deleted or is it the number of days for that the global blacklist database is kept ?
 

bidorbuy

Member
@twisted1919 : Why can't you give us an optional cronjob to purge the various logs. People who want to export logs can still do so and others will be able to still purge logs if they want to.

It should be rather easy to have a cron like:
Code:
/usr/bin/php -q /var/www/html/campaign/apps/console/console.php purge-log-(campaign-delivery|campaign-bounce|delivery-usage|all) ##

Where ## is the retention period in days.
 

Anand

Member
Ok, i created a file name performance-levels-custom.php in apps/common/config and used the code. But I can still see delivery logs table is getting updated. Anything that will run at midnight?
 

Anand

Member
if i want to keep only logs of 2-3 days? how can I do that. As i see the table becomes more than 20M in 2 days and slows everything.
 

Anand

Member
Hi,
sorry for the confusion. I wanted to ask if I want to move delivery logs data to archive logs everyday of let say every 2 day or 7 days. So that delivery log have only data of 2 days or max 7 days.
 

sendmedialtd

Active Member
or in the Cron settings in the backend change the value of "Delivery servers logs removal days" to 2 days so delivery logs will be deleted after 2 days.
 

twisted1919

Administrator
Staff member
so delivery logs will be deleted after 2 days.
this can have side effects, for example, if you keep track of how many emails your customers are sending in one month, then deleting those logs each two days will affect things.
Also, slower campaigns that take longer to deliver. might be affected by this.

While the advice is good, keep the above in mind.
 
Top