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

Got a requirement to audit a number of document libraries in a solution of mine.

Basically need to log all CRUD operations on a file within a document library to a SQL Server database and use an external list to pull data back into SharePoint for BI usuage.

The OOTB auditing feature doesn't cover the requirements so I have a couple of options:

  • Investigate usage and analysis logs to see if I can extract data from them, again I suspect these won't cover it. Plus how to I hook into the data, not investigated this before?

  • Use a custom HTTP module to intercept the request and check for files etc being open then log to database.

I can't use event receivers because there is no read event on a file, or is there something I don't know here.

Can't use a workflow because again it can only be triggered through updates and additions.

So wanted to ask you guys if there is a better solution before I dive into the second option above.

share|improve this question
up vote 5 down vote accepted

You are correct, there is no 'Read' event receiver, but you can create an HTTP Module to (painfully) track that information. See Logging document library downloads with HttpModule.

Alternatively the 'View', 'Update' and 'Delete' Audit events will give you this information, but auditing in SharePoint is pretty broken. For example Updates are also logged when an item is created as SharePoint does not have a 'Create' or 'Insert' audit event type.

You may want to consider this third party product to do the hard work. It fixes most of the shortcomings in SharePoint's own auditing infrastructure and logs all information to an easy to query database.

Please note that the link to the 3rd party component points to a product I worked on so the usual disclaimers apply.

share|improve this answer
I think a combination of HTTP module for read events and event receiver for the rest is the best solution IMO. I wanted to validate this approach in case I was missing something obvious with the OOTB features. – Lee Dale Jul 25 '11 at 9:06
Be vary careful what you do in your HTTP Module. Even a single call into the SharePoint OM will result in DB hits for all requests, including CSS, and Image based files. An absolute scalability killer if you get it wrong. – Muhimbi Jul 25 '11 at 9:19

If I understand you correctly, the SharePoint audit possibilities don't fulfill your needs? Can you please tell us on what area you need extra functionality? at the functionalities are described.

Is your requirement to get that auditlog data into some external system and analyze it from there? I know you can create an report in xlsx format, so I guess you can create something to get that data into your external system.

share|improve this answer

Ted Pattison has writen a great post about auditing on msdn - Just FYI :)

share|improve this answer

what part of the OOTB auditing feature doesn't cover your requirements?

share|improve this answer
OOTB feature does not capture data like timestamp and user. Also we want this stored as structured data not in a Excel file. This is because there is a requirement to use custom BI capabilities on top of the data at a later stage. – Lee Dale Jul 25 '11 at 9:04
This is really a comment, not an answer to the question. You can always comment on your own posts, and once you have sufficient reputation you will be able to comment on any post. – Stuart Pegg Aug 15 '12 at 16:30

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.