Click or drag to resize
EventLogServiceExtensionsLogWarning Method (IEventLogService, String, String, Exception, Int32, String, LoggingPolicy)
Writes a new warning to the event log.

Namespace: CMS.Core
Assembly: CMS.Core (in CMS.Core.dll) Version: 13.0.131
Syntax
C#
public static void LogWarning(
	this IEventLogService eventLogService,
	string source,
	string eventCode,
	Exception ex,
	int siteId = 0,
	string additionalMessage = null,
	LoggingPolicy loggingPolicy = null
)

Parameters

eventLogService
Type: CMS.CoreIEventLogService
Event log service that logs the arguments
source
Type: SystemString
Source of the event (Content, Administration, etc.)
eventCode
Type: SystemString
Event code (UPDATEDOC, SENDEMAIL, DELETE, etc.)
ex
Type: SystemException
Exception to be logged
siteId (Optional)
Type: SystemInt32
Current site ID
additionalMessage (Optional)
Type: SystemString
Additional information to the exception message
loggingPolicy (Optional)
Type: CMS.CoreLoggingPolicy
Logging policy

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEventLogService. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also