Enterprise Search Crawl Logs in MOSS 2007

When the web application is created and content source crawled, it gets listed in the the crawl logs of search. But when this application is deleted, the logs still contain reference to the deleted web application.

Doing further incremental or full crawls does not remove the stale entries from the crawl logs. Only way it happens, is to reset all the crawled content and start a full crawl. But this would have a huge impact where the amount of data to the crawled is huge.

We can access the crawl logs using the Object Model classes available in Microsoft.Office.Server.Search.Administration namespace, located in the Microsoft.Office.Server.Search.dll

Crawl logs are purged automatically after 7 days (default value). According to https://msdn.microsoft.com/en-us/library/ms553190.aspx

You use the LogViewer object to retrieve the crawl log data. The MaxDaysCrawlLogged property of the LogViewer object allows you to set the maximum numbers of days for the crawl log to keep data.

Though the article says that you can "set" the value of MaxDaysCrawlLogged to control the maximum number of days for the crawl log to keep the data, but seems like setting it does not have any effect. After checking with various resources and SharePoint internals, found that the property is available but is not working or does not have any effect on the crawl log. It is a dummy property which does not do anything.

This effectively means that you cannot make any changes to the max days a crawl log keeps the data and it remains to the default of 7 days only.

Happy Coding...