I'm using auditing functionality in my SharePoint site and I notice today that, through the results retrieved programatically by my SPAuditQuery object, my auditing count is mostly wrong because of multiple similar entries that appear (more than one time) in the generated xml file.

You can find for example, when a user load my site's homepage, 3 entries like "pages/default.aspx". even if the user arrives for the first time on the homepage and he never reloads the page. Sometimes I have 4 entries. So it's a very unpredictable behaviour !

How can I proceed if I want to have the correct count ? Does anyone have an idea ?



What exactly are you auditing? Be aware that auditing doesnt work on list items (by design) and is broken on publishing pages.

If you are just looking for general web analytics, i strongly recommend using another way of logging usage, such as javascript on pages (wont work for documents though).

If you do need users etc, consider creating a custom web control that creates a custom SPAuditEntry.

Check out my post on SO: https://stackoverflow.com/questions/921509/how-to-create-a-daily-summary-alert-for-any-change-in-a-sharepoint-site

Example on creating custom audit entries http://msdn.microsoft.com/en-us/library/bb397403.aspx#MOSS2007ItemLevelAudit_WritingCustomAuditEntries


I finally created a custom audit entry. It's quite simple to implement.

Thank you for your helpful msdn link. Now it works better.


  • can u add more details how u implemented it? Jun 16 '16 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy