Share via


SPAuditEntry Class

Contains information about an audited event that is connected to a site collection, site, folder, list, or list item.

Inheritance Hierarchy

System.Object
  Microsoft.SharePoint.SPAuditEntry

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No

Syntax

'Declaration
Public NotInheritable Class SPAuditEntry
'Usage
Dim instance As SPAuditEntry
public sealed class SPAuditEntry

Remarks

Most of the properties of SPAuditEntry hold information that is audited for all events (although some of these properties are a null reference (Nothing in Visual Basic) for certain kinds of events). The EventData property holds information, as XML markup, that is specific to the particular type of event identified in the Event property.

Examples

The following example (from Item-Level Auditing with SharePoint Server 2007) shows this class in use.

SPAuditQuery oAuditQuery = new SPAuditQuery(oSiteCollection);
oAuditQuery.RestrictToListItem(item);
SPAuditEntryCollection collAuditEntries = oSiteCollection.Audit.GetEntries(oAuditQuery);

foreach (SPAuditEntry oAuditEntry in collAuditEntries) {
  // get info from audit log
}
Dim oAuditQuery As New SPAuditQuery(oSiteCollection)
oAuditQuery.RestrictToListItem(item)
Dim collAuditEntries As SPAuditEntryCollection = oSiteCollection.Audit.GetEntries(oAuditQuery)

For Each oAuditEntry As SPAuditEntry In collAuditEntries
  ' get info from audit log
Next oAuditEntry

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

SPAuditEntry Members

Microsoft.SharePoint Namespace

Other Resources

Item-Level Auditing with SharePoint Server 2007