Table of Contents

Class EventLogProvider

Namespace
CMS.EventLog
Assembly
CMS.EventLog.dll

Provides basic operations with the event log.

[ProviderInterface(typeof(IEventLogInfoProvider))]
public class EventLogProvider : AbstractInfoProvider<EventLogInfo, EventLogProvider>, IInfoProvider, ICustomizableProvider, IBulkOperationProvider, IWebFarmProvider, IInfoValidator<EventLogInfo>, IInfoByGuidProvider<EventLogInfo>, IInfoByNameProvider<EventLogInfo>, IBulkInfoProvider<EventLogInfo>, IEventLogInfoProvider, IInfoProvider<EventLogInfo>, IInfoByIdProvider<EventLogInfo>
Inheritance
object
EventLogProvider
Implements
Inherited Members
Extension Methods

Constructors

EventLogProvider()

Initializes a new instance of the EventLogProvider class.

public EventLogProvider()

Properties

LogDocumentFieldChanges

Indicates if log should contain the changes to particular document document fields.

[Obsolete("The LogDocumentFieldChanges property is obsolete. Setting or reading this property will have no effect on the system behavior.")]
public static bool LogDocumentFieldChanges { get; set; }

Property Value

bool

LogFieldChanges

Indicates if log should contain the changes to particular fields.

[Obsolete("The LogFieldChanges property is obsolete. Setting or reading this property will have no effect on the system behavior.")]
public static bool LogFieldChanges { get; set; }

Property Value

bool

LoggingEnabled

Indicates if logging is enabled.

public static bool LoggingEnabled { get; set; }

Property Value

bool

Methods

CanLogEvent(EventLogInfo, bool)

Returns true if the event can be logged

protected virtual bool CanLogEvent(EventLogInfo eventObject, bool logDirectly)

Parameters

eventObject EventLogInfo

Event object

logDirectly bool

Whether the event is being logged directly (meaning not using the thread worker).

Returns

bool

CannotLogEventInternal(Exception)

Executes when the event logging throws an error.

protected virtual void CannotLogEventInternal(Exception ex)

Parameters

ex Exception

Exception thrown upon problem with logging

ClearHashtables(bool)

Clears up hashtables of EventLogProvider.

protected override void ClearHashtables(bool logTasks)

Parameters

logTasks bool

If true, web farm tasks are logged

GetEventLogText(EventLogInfo)

Creates string representation of event log object.

public static string GetEventLogText(EventLogInfo eventLogInfo)

Parameters

eventLogInfo EventLogInfo

EventLogInfo object

Returns

string

GetEventLogTextInternal(EventLogInfo)

Creates string representation of event log object.

protected virtual string GetEventLogTextInternal(EventLogInfo eventLogInfo)

Parameters

eventLogInfo EventLogInfo

EventLogInfo object

Returns

string

GetExceptionLogMessage(Exception)

Gets complete log for exception with message and deep stack trace.

public static string GetExceptionLogMessage(Exception ex)

Parameters

ex Exception

Exception to log

Returns

string

GetExceptionLogMessageInternal(Exception)

Gets complete log for exception with message and deep stack trace.

protected virtual string GetExceptionLogMessageInternal(Exception ex)

Parameters

ex Exception

Exception to log

Returns

string

GetLogSize()

Gets the log size.

public static int GetLogSize()

Returns

int

GetLogSizeInternal()

Gets the log size.

protected virtual int GetLogSizeInternal()

Returns

int

LogEvent(EventLogInfo)

Writes a new record to the event log.

public static EventLogInfo LogEvent(EventLogInfo eventObject)

Parameters

eventObject EventLogInfo

Event object.

Returns

EventLogInfo

LogEventInternal(EventLogInfo)

Writes a new record to the event log.

protected virtual EventLogInfo LogEventInternal(EventLogInfo eventObject)

Parameters

eventObject EventLogInfo

Contains event

Returns

EventLogInfo

LogEventInternal(EventLogInfo, bool)

Writes a new record to the event log.

protected virtual EventLogInfo LogEventInternal(EventLogInfo eventObject, bool logDirectly)

Parameters

eventObject EventLogInfo

Contains event

logDirectly bool

If true, the event is logged directly to the database. Otherwise, the event is logged to the queue processed by background worker to optimize performance.

Returns

EventLogInfo

LogMetadata()

Returns true if the metadata should be logged.

public static bool LogMetadata()

Returns

bool

Set(EventLogInfo)

Inserts or updates the info object in the underlying data store.

public override void Set(EventLogInfo info)

Parameters

info EventLogInfo

Info object to be inserted or updated.

Exceptions

ArgumentNullException

Thrown when info is null.