Class EventLogService
Service logs events via registered implementations of IEventLogWriter and ensures the contextual information in the logged data.
public class EventLogService : IEventLogService
- Inheritance
-
objectEventLogService
- Implements
- Extension Methods
Constructors
EventLogService()
Initializes a new instance of the EventLogService class.
protected EventLogService()
EventLogService(IEnumerable<IEventLogWriter>)
Initializes a new instance of the EventLogService class.
public EventLogService(IEnumerable<IEventLogWriter> writers)
Parameters
writers
IEnumerable<IEventLogWriter>Collection of writers that will write the event log information into an appropriate output.
Methods
EnsureContextInformation(EventLogData)
Fills the EventLogData with contextual information about the current request and machine.
protected void EnsureContextInformation(EventLogData eventLogData)
Parameters
eventLogData
EventLogDataEvent log data to be filled with contextual information.
Remarks
The contextual data is filled only when they are null
.
LogEvent(EventLogData)
Passes event log data to be written by all registered event log writers and provides the contextual information.
public virtual void LogEvent(EventLogData eventLogData)
Parameters
eventLogData
EventLogDataData passed to the event log writers.
Remarks
Ensures contextual information in the EventLogData's
properties if they are null
when passed to the method.
The following properties are filled with contextual data:
- See Also