I noticed recently after implementing the mail parser that my parser logs were being cleared rapidly. Despite having set the log churn in the mail pareser settings to 30 days, they were being deleted prior to this date.
I discovered after a little investigation that the daily cleanup cron job is what does the clearing of the parser log. The issue is that within the cron cleanup, there is a bug in which it uses the log clearing timeline as set in the "CPU Optimization & Server Settings" NOT the mail parser "Log Churn Timeline" as it should.
Thsi is simply due to the fact that in the code contained in cron_cleanup.php, there is no line that reads the value for the mail parser log churn, it just uses the one specified on the server settings page.
** No warranty, liability or support provided for implementing the following code. Do so at your own risk! **
Simply ADD the following line of code to the top of the if statement shown below in cron_cleanup.php in the modules\core folder:
$cleartime = DATENOW - (intval($_SWIFT["settings"]["pr_logchurndays"])*86400);
Code:
if ($module->isRegistered(MODULE_PARSER))
{
$cleartime = DATENOW - (intval($_SWIFT["settings"]["pr_logchurndays"])*86400);
$_parserlogidlist = array();
$dbCore->query("SELECT `parserlogid` FROM `". TABLE_PREFIX ."parserlogs` WHERE `dateline` < '". intval($cleartime) ."';");
while ($dbCore->nextRecord())
{
$_parserlogidlist[] = $dbCore->Record["parserlogid"];
}
if (count($_parserlogidlist))
{
$dbCore->query("DELETE FROM `". TABLE_PREFIX ."parserlogs` WHERE `parserlogid` IN (". buildIN($_parserlogidlist) .");");
$dbCore->query("DELETE FROM `". TABLE_PREFIX ."parserlogdata` WHERE `parserlogid` IN (". buildIN($_parserlogidlist) .");");
}
}