Skip to end of metadata
Go to start of metadata

Provides tracing services through a set of TraceListeners.

Definition

public class LogSource : IDisposable

Summary

The following table summarizes the members exposed in this class.

Public Constructors

LogSource Constructor(string) Initializes a new instance of the LogSource class with a name.
LogSource Constructor(string, SourceLevel) Initializes a new instance of the LogSource class with a name and a level.
LogSource Constructor(string, List<TraceListener>, SourceLevel) Initializes a new instance of the LogSource class with a name, a collection of TraceListeners and a level.
LogSource Constructor(string, List<TraceListener>, SourceLevel, bool) Initializes a new instance of the LogSource class with a name, a collection of TraceListeners, a level and the auto flush.
LogSource Constructor(string, CategoryFilter, List<TraceListener>, SourceLevel) Initializes a new instance of the LogSource class with a name, a collection of TraceListeners, a level and the auto flush.
LogSource Constructor(string, CategoryFilter, List<TraceListener>, SourceLevel, bool) Initializes a new instance of the LogSource class with a name, a collection of TraceListeners, a level and the auto flush.

Public Properties

AutoFlush Gets or sets the LogSource values for the LogSource instance.
CategoryFilter Gets or sets the category filter.
Level Gets or sets the SourceLevel values at which to trace for the LogSource instance.
Listeners Gets the collection of trace listeners for the LogSource instance.
Name Gets the name for the LogSource instance.

Constants

DefaultAutoFlushProperty Default Auto Flush property for the LogSource instance.

Public Methods

Dispose() Releases the resources used by the LogSource.
TraceData(SeverityType, int, LogEntry) Writes trace data to the trace listeners in the LogSource collection using the specified event type, event identifier, and trace data.
TraceData(SeverityType, int, LogEntry, TraceListenerFilter) Writes trace data to the trace listeners in the LogSource collection that have not already been written to for tracing using the specified event type, event identifier, and trace data.

Public Constructors

public LogSource(string name)

Initializes a new instance of the LogSource class with a name.

Parameters

name The name for the instance.

public LogSource(string name, SourceLevel level)

Initializes a new instance of the LogSource class with a name and a level.

Parameters

name The name for the instance.
level The SourceLevel value.

public LogSource(string name, List<TraceListener> traceListeners, SourceLevel level)

Initializes a new instance of the LogSource class with a name, a collection of TraceListeners and a level.

Parameters

name The name for the instance.
traceListeners The collection of TraceListeners.
level The SourceLevel value.

public LogSource(string name, List<TraceListener> traceListeners, SourceLevel level, bool autoFlush)

Initializes a new instance of the LogSource class with a name, a collection of TraceListeners, a level and the auto flush.

Parameters

name The name for the instance.
traceListeners The collection of TraceListeners.
level The SourceLevel value.
autoFlush If Flush should be called on the Listeners after every write.

public LogSource(string name, CategoryFilter categoryFilter, List<TraceListener> traceListeners, SourceLevel level)

Initializes a new instance of the LogSource class with a name, a collection of TraceListeners, a level and the auto flush.

Parameters

name The name for the instance.
categoryFilter The category filter..
traceListeners The collection of TraceListeners.
level The SourceLevel value.

public LogSource(string name, CategoryFilter categoryFilter, List<TraceListener> traceListeners, SourceLevel level, bool autoFlush)

Initializes a new instance of the LogSource class with a name, a collection of TraceListeners, a level and the auto flush.

Parameters

name The name for the instance.
categoryFilter The category filter.
traceListeners The collection of TraceListeners.
level The SourceLevel value.
autoFlush If Flush should be called on the Listeners after every write.

Public Properties

public bool AutoFlush { get; set; }

Gets or sets the LogSource values for the LogSource instance.

public CategoryFilter CategoryFilter { get; set; }

Gets or sets the category filter.

public SourceLevel Level { get; set; }

Gets or sets the SourceLevel values at which to trace for the LogSource instance.

public List<TraceListener> Listeners { get; }

Gets the collection of trace listeners for the LogSource instance.

public string Name { get; }

Gets the name for the LogSource instance.

Constants

public const bool DefaultAutoFlushProperty

Default Auto Flush property for the LogSource instance.

Public Methods

public void Dispose()

Releases the resources used by the LogSource.

public void TraceData(SeverityType eventType, int id, LogEntry logEntry)

Writes trace data to the trace listeners in the LogSource collection using the specified event type, event identifier, and trace data.

Parameters

eventType The value that specifies the type of event that caused the trace.
id A numeric identifier for the event.
logEntry The LogEntry to trace.

public void TraceData(SeverityType eventType, int id, LogEntry logEntry, TraceListenerFilter traceListenerFilter)

Writes trace data to the trace listeners in the LogSource collection that have not already been written to for tracing using the specified event type, event identifier, and trace data.

Remarks

The <paramref name="traceListenerFilter" /> will be updated to reflect the trace listeners that were written to by the LogSource.

Parameters

eventType The value that specifies the type of event that caused the trace.
id A numeric identifier for the event.
logEntry The LogEntry to trace.
traceListenerFilter The filter for already written to trace listeners.
  • No labels