Best way to keep the TYPO3 sys_log nice & clean?

Yes and No

It IS NOT if you care about your record history. You can revert changes to records (content, pages etc.) using the sys_history table. The sys_history tables and sys_log tables are related. When you truncate sys_log, you also loose the ability to rollback any changes to the system. Your clients may not like that.

It IS if you only care about the sys_log size. Truncating the table via cron is fine.

In TYPO3 4.6 and up you can use the Table garbage collection scheduler task als pgampe says. For TYPO3 versions below 4.5 you can use the tablecleaner extension. If you remove all records from sys_log older than [N] days, you will also retain your record history for [N] days. That seems to be the best solution to me.

And please try to fix what is filling your sys_log in the first place ;-)


There is a scheduler task for this.

It is called Table garbage collection (scheduler).

In TYPO3 4.7, it can only clean the sys_log table. Starting from TYPO3 6.0, it can also clean the sys_history table. You can configure the number of days and what tables to clean.

Extensions may register further tables to clean.

Tags:

Typo3