Class CyclicTraceListener
Provides a simple daily cyclic trace listener.
The trace listener is configured in web.config as follows.
add name="CyclicTextWriter" type="ComponentSpace.SAML2.Utility.CyclicTraceListener,ComponentSpace.SAML2" initializeData="logs"/>
The initializeData is the relative or absolute path to the log folder.
For example:
initializeData="logs/saml"
initializeData="logs\saml"
initializeData="c:/logs/saml"
initializeData="c:\logs\saml"
Inheritance
Implements
Inherited Members
Namespace: ComponentSpace.SAML2.Utility
Assembly: ComponentSpace.Saml2.dll
Syntax
public class CyclicTraceListener : TraceListener, IDisposable
Constructors
CyclicTraceListener(String)
Initializes an instance of the CyclicTraceListener
.
Declaration
public CyclicTraceListener(string directoryName)
Parameters
Type | Name | Description |
---|---|---|
System.String | directoryName | The directory into which log files will be written. |
Methods
TraceEvent(TraceEventCache, String, TraceEventType, Int32)
Traces an event.
Declaration
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id)
Parameters
Type | Name | Description |
---|---|---|
System.Diagnostics.TraceEventCache | eventCache | The trace event cache. |
System.String | source | The trace source. |
System.Diagnostics.TraceEventType | eventType | The trace event type. |
System.Int32 | id | The event ID. |
Overrides
TraceEvent(TraceEventCache, String, TraceEventType, Int32, String)
Traces an event.
Declaration
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string message)
Parameters
Type | Name | Description |
---|---|---|
System.Diagnostics.TraceEventCache | eventCache | The trace event cache. |
System.String | source | The trace source. |
System.Diagnostics.TraceEventType | eventType | The trace event type. |
System.Int32 | id | The event ID. |
System.String | message | The event message. |
Overrides
TraceEvent(TraceEventCache, String, TraceEventType, Int32, String, Object[])
Traces an event.
Declaration
public override void TraceEvent(TraceEventCache eventCache, string source, TraceEventType eventType, int id, string format, params object[] args)
Parameters
Type | Name | Description |
---|---|---|
System.Diagnostics.TraceEventCache | eventCache | The trace event cache. |
System.String | source | The trace source. |
System.Diagnostics.TraceEventType | eventType | The trace event type. |
System.Int32 | id | The event ID. |
System.String | format | The format string. |
System.Object[] | args | The format string arguments. |
Overrides
Write(String)
Writes an event message.
Declaration
public override void Write(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The event message. |
Overrides
WriteLine(String)
Writes an event message.
Declaration
public override void WriteLine(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The event message. |