SPAudit.WriteAuditEvent method (String, String, Int32, String)
Writes the audit entry with customized user ID.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaration
Public Function WriteAuditEvent ( _
eventName As String, _
eventSource As String, _
userId As Integer, _
xmlData As String _
) As Boolean
'Usage
Dim instance As SPAudit
Dim eventName As String
Dim eventSource As String
Dim userId As Integer
Dim xmlData As String
Dim returnValue As Boolean
returnValue = instance.WriteAuditEvent(eventName, _
eventSource, userId, xmlData)
public bool WriteAuditEvent(
string eventName,
string eventSource,
int userId,
string xmlData
)
Parameters
eventName
Type: System.StringThe event name.
eventSource
Type: System.StringThe name of the calling application.
userId
Type: System.Int32The customized user ID.
xmlData
Type: System.StringThe information about the event.
Return value
Type: System.Boolean
true if the event was recorded successfully; otherwise, false.
Remarks
Only the System Account will be able to specify the user ID. All other users trying to specify different IDs from their own will be regarded as spoofing and be terminated.