Clear Error Log - Quick Fix

3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 23, 2017   (RSS)

By Perchpole - March 22, 2017

Hello, All -

I need a quick fix to make life a little easier!

My client has an ageing site running CMSB v2.65. The site is very busy and the sheer weight of traffic is causing  a large number of errors to build up every day. This morning, for example, the re were almost 1,000. This is causing the MySQL database to fill up with unwanted data to the point where it will no longer accept any new posts. The site "locks up" and I then have to manually flush the error log.

What I would like to do is put a cron script in place that will clear out the error log every couple of hours. I am currently in the process of editing the cron-example.php script but I am not sure what the correct command should be.

Any help would be most welcome.



By Dave - March 22, 2017

Hi Perch, 

I'm not sure about v2.65, but in recent versions the the error log will automatically limit itself to the last 1000 entries to prevent creating too much data.

Also, if you edit /lib/errorlog_functions.php and comment this out at the top you can disable error logging: 

// enable error logging
if (isInstalled()) {
  //errorlog_enable(); // comment this line to disable error logging

Let me know if that works for you.

Dave Edis - Senior Developer