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 would like to know if there's a way to refresh the Auditing log programmatically, because we need it to see in real time which the last accessed document was within a Document Library.

Thanks, Brian

share|improve this question

What do you mean by update? Change the data?

If you just need to view the data, some code like this has worked for me:

SPAuditQuery query = new SPAuditQuery(site);
SPAuditEntryCollection auditCol = list.Audit.GetEntries(query);

Then you just loop through the auditCol and add it to a dataset and bind to a datagrid for output.

share|improve this answer

You may want to make sure you are setup to audit the events you are looking to capture. Here is a good overview blog post:

share|improve this answer

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.