Monday, February 09, 2009

Preventing IIS from logging activity on a specific sharepoint site

A friend at "Kraft Foods" sent me the following tip to share with you. I must say that I didn't try it myself - so use at your own risk.

The problem
IIS logs activity for a sharepoint web application, for all sites. If you have a web application with a lot of sites, and a lot of activity, the IIS logs may grow out of proportion and make analysis of the logs harder and harder. What if you don't want it to audit all sites, but just some of them? what if we want to exclude a certain site that is hit often, and we don't care if it is audited by IIS?

Well, if our site was a regular .net site, we would have the folders of that site (the virtual directories) shown and we could mark places in the hierarchy that we do not want to audit. But SharePoint does not create virtual folders in IIS, instead IIS has only one folder for all site collections in the web application.

The solution
According to my friend, the solution is to manually create folders under the IIS physical folder by the url names of the sites that you want to exclude. For example, if you have a site called "News" that you want to exclude from the logs, go to "C:\inetpub\wwwroot\wss\VirtualDirectories\{your web application}" and create a folder "News". Then, in IIS right click the folder, and configure it to be excluded from the logs.

More Info
I couldnt find how to exclude the folder in windows 2008 - but in IIS6 you can do that under "Directories" tab, by setting "Log Visits" = unchecked.

No comments: