We use SQL Server full text search functionality. As a result we have lots of full text log files like SQLFT0003200286.LOG.5 in the sql server error log folder. Is there anything we can do to ensure these files are periodically purged (oldest files purged first)?
1 Answer
It seems your option is this undocumented stored procedure running in a job:
EXEC sp_fulltext_recycle_crawl_log @ftcat = 'FullTextCatalogName';
Check the Recycle Fulltext Catalog Log Files article by Jonathan Kehayias.
I just tested it in a lab environment and it purges the oldest fulltext log file creating a new live file (in my lab I could see 1 live file and 6 old files, so this must be the default number of files SQL Server keeps).
USE YourDatabase; SELECT 'EXEC sp_fulltext_recycle_crawl_log @ftcat = ''' + name + ''';' FROM sys.fulltext_catalogs;
to generate scripts for all catalogs at once. And you can add that tosp_msforeachdb
or an improved version.