Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
LOGS not being deleted
Hi,
In Admin Prefs I have delete logs set to … after 2 days.
I noticed today that I had 333,000+ rows in the table.
I’ve manually deleted them but does anyone have any ideas why isn’t this happening automatically?
Thanks
Geoff
There are 10 types of people in the world: those who understand binary, and those who don’t.
Offline
Re: LOGS not being deleted
geoff777 wrote:
I’ve manually deleted them but does anyone have any ideas why isn’t this happening automatically?
Old rows are deleted only when site admin visits the Visitor Logs admin panel. If no one has visited the panel lately, there might be older records.
Offline
Re: LOGS not being deleted
Wow!
I’m surprised that there wasn’t 300,000,000 rows … I can’t remember the last time I clicked on that tab.
Okay .. I’ll click on it daily from now on.
Thanks
There are 10 types of people in the world: those who understand binary, and those who don’t.
Offline
Re: LOGS not being deleted
If you don’t look at the logs, you may want to consider disabling logging completely.
Offline
Re: LOGS not being deleted
ruud wrote:
If you don’t look at the logs, you may want to consider disabling logging completely.
I use mem_online_users which uses the logs.
I also save daily totals using smd_query on txp_log.
I hadn’t given this any thought until I saw number of rows in the table.
I had wrongly assumed that when I set a number of days to keep the logs for in Admin Prefs that deleting older records would be handled by Textpattern.
I had thought the deletion was a daily “behind the scenes” clean-up … a cron job?
Now I know this isn’t he case I’ll keep a closer check on the table.
When I total the previous day’s visitors, I’ll now delete the records.
Thank
Geoff
Last edited by geoff777 (2010-07-16 19:44:20)
There are 10 types of people in the world: those who understand binary, and those who don’t.
Offline
Re: LOGS not being deleted
geoff777 wrote:
I had thought the deletion was a daily “behind the scenes” clean-up … a cron job?
Well, the problem is that TXP is just an application written in PHP. PHP by itself can’t do timed tasks. Instead, it just does something when told to.
If the in-build cleaning was timed, it would mean that the cleaning would be checked and done on the frontside of the site. The problem is that it would slow the pages down and databases do not really like constant deleting. Sure, we could store time intervals and run deleting systematically, but even then some of the visitors would experience slower page loading. This is basically why the cleaning is done on the Visitor logs panel.
That said, if you want to setup a cron job and run cleaning silently, every other day, you can. You can install cron job that opens mysql connection and removes old rows. This tutorial might come handy:
Offline
Pages: 1