Class EventLogProvider
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
-
objectEventLogProvider
- 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
eventObjectEventLogInfoEvent object
logDirectlyboolWhether 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
exExceptionException thrown upon problem with logging
ClearHashtables(bool)
Clears up hashtables of EventLogProvider.
protected override void ClearHashtables(bool logTasks)
Parameters
logTasksboolIf true, web farm tasks are logged
GetEventLogText(EventLogInfo)
Creates string representation of event log object.
public static string GetEventLogText(EventLogInfo eventLogInfo)
Parameters
eventLogInfoEventLogInfoEventLogInfo object
Returns
- string
GetEventLogTextInternal(EventLogInfo)
Creates string representation of event log object.
protected virtual string GetEventLogTextInternal(EventLogInfo eventLogInfo)
Parameters
eventLogInfoEventLogInfoEventLogInfo object
Returns
- string
GetExceptionLogMessage(Exception)
Gets complete log for exception with message and deep stack trace.
public static string GetExceptionLogMessage(Exception ex)
Parameters
exExceptionException to log
Returns
- string
GetExceptionLogMessageInternal(Exception)
Gets complete log for exception with message and deep stack trace.
protected virtual string GetExceptionLogMessageInternal(Exception ex)
Parameters
exExceptionException 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
eventObjectEventLogInfoEvent object.
Returns
LogEventInternal(EventLogInfo)
Writes a new record to the event log.
protected virtual EventLogInfo LogEventInternal(EventLogInfo eventObject)
Parameters
eventObjectEventLogInfoContains event
Returns
LogEventInternal(EventLogInfo, bool)
Writes a new record to the event log.
protected virtual EventLogInfo LogEventInternal(EventLogInfo eventObject, bool logDirectly)
Parameters
eventObjectEventLogInfoContains event
logDirectlyboolIf 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
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
infoEventLogInfoInfo object to be inserted or updated.
Exceptions
- ArgumentNullException
Thrown when
infois null.