SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 ?


share|improve this question
up vote 0 down vote accepted

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:

Example on creating custom audit entries

share|improve this answer

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

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


share|improve this answer
can u add more details how u implemented it? – Mani Dharmarajan Jun 16 at 12:01

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.