3

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.

4 Answers 4

5

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.

2
  • 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, 2011 at 9:06
  • 1
    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. Jul 25, 2011 at 9:19
3

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 http://office.microsoft.com/en-us/sharepoint-server-help/view-audit-log-reports-HA102039795.aspx 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.

2

Ted Pattison has writen a great post about auditing on msdn http://msdn.microsoft.com/en-us/library/bb397403(office.12).aspx - Just FYI :)

0

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

1
  • 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, 2011 at 9:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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