Click or drag to resize
EventLogProviderLogEvent Method (String, String, String, String, String, Int32, String, Int32, String, String, Int32, String, String, String, NullableDateTime, LoggingPolicy)
Writes a new record to the event log.

Namespace: CMS.EventLog
Assembly: CMS.EventLog (in CMS.EventLog.dll) Version: 10.0.0
Syntax
C#
public static EventLogInfo LogEvent(
	string eventType,
	string source,
	string eventCode,
	string eventDescription = null,
	string eventUrl = null,
	int userId = 0,
	string userName = null,
	int nodeId = 0,
	string documentName = null,
	string ipAddress = null,
	int siteId = 0,
	string machineName = null,
	string urlReferrer = null,
	string userAgent = null,
	Nullable<DateTime> eventTime = null,
	LoggingPolicy loggingPolicy = null
)

Parameters

eventType
Type: SystemString
Type of the event. Please use predefined constants from EventLogProvider
source
Type: SystemString
Source of the event (Content, Administration, etc.)
eventCode
Type: SystemString
Event code (UPDATEDOC, SENDEMAIL, DELETE, etc.)
eventDescription (Optional)
Type: SystemString
Detailed description of the event
eventUrl (Optional)
Type: SystemString
Event URL address
userId (Optional)
Type: SystemInt32
ID of the user, who caused logged event
userName (Optional)
Type: SystemString
Name of the user, who caused logged event
nodeId (Optional)
Type: SystemInt32
ID value of the document
documentName (Optional)
Type: SystemString
NamePath value of the document
ipAddress (Optional)
Type: SystemString
IP Address of the user, who caused logged event
siteId (Optional)
Type: SystemInt32
ID of the site
machineName (Optional)
Type: SystemString
Name of machine
urlReferrer (Optional)
Type: SystemString
Referrer URL
userAgent (Optional)
Type: SystemString
User agent
eventTime (Optional)
Type: SystemNullableDateTime
Date and time when the event occurs
loggingPolicy (Optional)
Type: CMS.CoreLoggingPolicy
Logging policy.

Return Value

Type: EventLogInfo
See Also