Click or drag to resize
EventLogProviderLogEvent Method (String, String, String, String, String, Int32, String, Int32, String, String, Int32, String, String, String, NullableDateTime, LoggingPolicy)

Note: This API is now obsolete.

Writes a new record to the event log.

This method is obsolete and will be removed in future version. Use LogEvent(EventLogData) or LogEvent(IEventLogService, EventTypeEnum, String, String, String) instead.

Namespace: CMS.EventLog
Assembly: CMS.EventLog (in CMS.EventLog.dll) Version: 13.0.131
Syntax
C#
[ObsoleteAttribute("Use 'CMS.Core.Service.Resolve<CMS.Core.IEventLogService>().LogEvent(CMS.EventLog.EventType.ToEventTypeEnum(eventType), source, eventCode, eventDescription)' or 'CMS.Core.Service.Resolve<CMS.Core.IEventLogService>().LogEvent(new CMS.Core.EventLogData(CMS.EventLog.EventType.ToEventTypeEnum(eventType), source, eventCode) { ... })' code instead.")]
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 EventType
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