SPAudit.WriteAuditEvent Method (SPWeb, String, SPAuditItemType, SPAuditEventType, String, String, String)
Writes an unrestricted volume of data to the audit history in the SharePoint database.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: No
Syntax
'Declaration
Public Shared Function WriteAuditEvent ( _
web As SPWeb, _
serverRelativeUrl As String, _
itemType As SPAuditItemType, _
eventId As SPAuditEventType, _
eventName As String, _
eventSource As String, _
xmlData As String _
) As Boolean
'Usage
Dim web As SPWeb
Dim serverRelativeUrl As String
Dim itemType As SPAuditItemType
Dim eventId As SPAuditEventType
Dim eventName As String
Dim eventSource As String
Dim xmlData As String
Dim returnValue As Boolean
returnValue = SPAudit.WriteAuditEvent(web, _
serverRelativeUrl, itemType, eventId, _
eventName, eventSource, xmlData)
public static bool WriteAuditEvent(
SPWeb web,
string serverRelativeUrl,
SPAuditItemType itemType,
SPAuditEventType eventId,
string eventName,
string eventSource,
string xmlData
)
Parameters
web
Type: Microsoft.SharePoint.SPWebThe Web associated with the event.
serverRelativeUrl
Type: System.StringThe path of the item associated with the event.
itemType
Type: Microsoft.SharePoint.SPAuditItemTypeThe type of the item associated with the event.
eventId
Type: Microsoft.SharePoint.SPAuditEventTypeThe event type of the record.
eventName
Type: System.StringThe name of the event (used if eventId is a custom event).
eventSource
Type: System.StringThe source of the event. This parameter is optional.
xmlData
Type: System.StringThe information about the event.
Return Value
Type: System.Boolean
true if the event was recorded successfully; otherwise, false.