ComponentSpace.TraceListeners

ComponentSpace Trace Listeners Class Library Reference

ComponentSpace.TraceListeners Namespace

The ComponentSpace.TraceListeners namespace contains various trace listener classes.

Namespace hierarchy

Classes

Class | Description
CyclicFileTraceListener | The CyclicFileTraceListener is a trace listener that writes to a file (eg. 00000.log), until it reaches a configurable size, and then writes to the next file in the sequence (00001.log).
HttpTraceListener | The HttpTraceListener is a trace listener that uploads trace messages to a URL.
MsmqTraceListener | The MsmqTraceListener is a trace listener that writes messages to a queue.
SmtpTraceListener | The SmtpTraceListener is a trace listener that emails messages.


CyclicFileTraceListener Class

The CyclicFileTraceListener is a trace listener that writes to a file (eg. 00000.log), until it reaches a configurable size, and then writes to the next file in the sequence (00001.log).

For a list of all members of this type, see CyclicFileTraceListener Members.

System.Object
System.MarshalByRefObject
System.Diagnostics.TraceListener
ComponentSpace.TraceListeners.CyclicFileTraceListener

[Visual Basic]
Public Class CyclicFileTraceListener
Inherits TraceListener
[C#]
public class CyclicFileTraceListener : TraceListener

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

Trace files are written to the specified directory and are named:

<DirectoryName>\<FilePrefix><SequenceNumber><FileSuffix>

Using the default properties, trace file are named .\00000.log, .\00001.log etc with each file no more then 64 kbytes.

The following is an example of configuring the trace listener using the application's XML configuration file. NB. String values may either be enclosed in "double quotation marks" or 'single quotation marks' using XML entity references where required.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.diagnostics>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add
          name="CyclicFileTraceListener"
          type="ComponentSpace.TraceListeners.CyclicFileTraceListener,ComponentSpace.TraceListeners"
          initializeData="directoryName='c:\logs',
                          fieldSeparator=';',
                          filePrefix='mylog',
                          fileSequenceNumber=1000,
                          fileSuffix='.txt',
                          includeCallersName=true,
                          includePidTid=true,
                          includeTimeStamp=true,
                          maxFileSize=8192,
                          maxFileCount=100"/>
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>

The configuration property names and valid values are:

directoryName

directoryName is a string specifying the directory in which to write trace file eg. directoryName="c:\logs". The trace directory defaults to the current directory.

fieldSeparator

fieldSeparator is a string specifying the field separator to use in the trace entries eg. fieldSeparator=";". The default field separator is ", ".

filePrefix

filePrefix is a string specifying the prefix used to construct the file name eg. filePrefix="mylog". The default is to use no file prefix.

fileSequenceNumber

fileSequenceNumber is a number specifying the initial file sequence number eg. fileSequenceNumber=1000. The default sequence number is zero.

fileSuffix

fileSuffix is a string specifying the suffix used to construct the file name eg. fileSuffix=".txt". The default file suffix is ".log".

includeCallersName

includeCallersName is a boolean specifying whether to include the caller's class and method name in the trace entries eg. includeCallersName=true. The default is false.

includePidTid

includePidTid is a boolean specifying whether to include process and thread identifiers in the trace entries eg. includePidTid=false. The default is false.

includeTimeStamp

includeTimeStamp is a boolean specifying whether to include a timestamp in the trace entries eg. includeTimeStamp=true. The default is true.

maxFileSize

maxFileSize is a number specifying maximum file size in bytes eg. maxFileSize=8192. The file size defaults to 64 kilobytes.

maxFileCount

maxFileCount is a number specifying maximum number of files eg. maxFileCount=10. The file count defaults to an unlimited number of files.

If a maximum file count is specified then once the maximum number of files have been created then log entries will wrap around to the earliest file. For example, if log files 00000.log through to 00009.log exist and the maximum file count is 10 then entries starting at 00000.log are overwritten.

Examples

To specify the directory and maximum file size but default the other parameters: directoryName="c:\logs", maxFileSize=8192

To enable PID/TID and caller name tracing: includePidTid=true, includeCallersName=true

To modify all properties: directoryName="c:\logs", fieldSeparator=";", filePrefix="mylog", fileSequenceNumber=1000, fileSuffix=".txt", includeTimeStamp=false, includePidTid=true, includeTimeStamp=true, maxFileSize=8192, maxFileCount=10

Requirements

Namespace: ComponentSpace.TraceListeners

Assembly: ComponentSpace.TraceListeners (in ComponentSpace.TraceListeners.dll)

See Also

CyclicFileTraceListener Members | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener Members

CyclicFileTraceListener overview

Public Static (Shared) Fields

UNLIMITED_FILE_COUNTS Indicates no limit on the maximum number of trace files.

Public Instance Constructors

CyclicFileTraceListener Overloaded. Initializes a new instance of the CyclicFileTraceListener class.

Public Instance Properties

DirectoryName | Gets the directory in which to write trace files.
FieldSeparator | Gets the field separator in the output.
FilePrefix | Gets the prefix used when forming trace file names.
FileSequenceNumber | Gets the initial file sequence number.
FileSuffix | Gets the suffix used when forming trace file names.
IncludeCallersName | Gets the flag indicating whether to include the caller's class and method name.
IncludePidTid | Gets the flag indicating whether to include the process and thread identifiers.
IncludeTimeStamp | Gets the flag indicating whether to include a timestamp.
IndentLevel (inherited from TraceListener) | Gets or sets the indent level.
IndentSize (inherited from TraceListener) | Gets or sets the number of spaces in an indent.
MaxFileCount | Gets the maximum number of trace files. A zero value indicates no limit is placed on the number of files.
MaxFileSize | Gets the maximum size of the trace files in bytes.
Name (inherited from TraceListener) | Gets or sets a name for this TraceListener.

Public Instance Methods

Close | Close the trace file.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from TraceListener) | Overloaded. Releases all resources used by the TraceListener .
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fail (inherited from TraceListener) | Overloaded. Emits an error message, and a detailed error message to the listener you create when you implement the TraceListener class.
Flush | Flush the trace file.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Write (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
Write | Overloaded. Write the message to the trace file.
WriteLine (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class, followed by a line terminator.
WriteLine | Overloaded. Write the message and a new line to the trace file.

Protected Instance Properties

NeedIndent (inherited from TraceListener) Gets or sets a value indicating whether to indent the output.

Protected Instance Methods

Dispose | Overloaded. Releases the unmanaged resources used by the CyclicFileTraceListener and optionally releases the managed resources.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
WriteIndent (inherited from TraceListener) | Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener Constructor

Initializes a new instance of the CyclicFileTraceListener using the supplied initialization data.

Overload List

Initializes a new instance of the CyclicFileTraceListener using the supplied initialization data.

public CyclicFileTraceListener(string);

Initializes a new instance of the CyclicFileTraceListener using the supplied parameters.

public CyclicFileTraceListener(string,long,long,string,string,long,bool,bool,bool,string);

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener Constructor (String)

Initializes a new instance of the CyclicFileTraceListener using the supplied initialization data.

[Visual Basic]
Overloads Public Sub New( _
ByVal initializeData As String _
)
[C#]
public CyclicFileTraceListener(
string initializeData
);

Parameters

initializeData
The initialization data.

Remarks

The initialization data consists of zero of more comma separated properties.

For a description of the initialization data see CyclicFileTraceListener.

This constructor receives the initialization data configured in the application's XML configuration file.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace | CyclicFileTraceListener Constructor Overload List


CyclicFileTraceListener Constructor (String, Int64, Int64, String, String, Int64, Boolean, Boolean, Boolean, String)

Initializes a new instance of the CyclicFileTraceListener using the supplied parameters.

[Visual Basic]
Overloads Public Sub New( _
ByVal directoryName As String, _
ByVal maxFileSize As Long, _
ByVal maxFileCount As Long, _
ByVal filePrefix As String, _
ByVal fileSuffix As String, _
ByVal fileSequenceNumber As Long, _
ByVal includeTimeStamp As Boolean, _
ByVal includePidTid As Boolean, _
ByVal includeCallersName As Boolean, _
ByVal fieldSeparator As String _
)
[C#]
public CyclicFileTraceListener(
string directoryName,
long maxFileSize,
long maxFileCount,
string filePrefix,
string fileSuffix,
long fileSequenceNumber,
bool includeTimeStamp,
bool includePidTid,
bool includeCallersName,
string fieldSeparator
);

Parameters

directoryName
The directory in which to write trace files.
maxFileSize
The maximum file size.
maxFileCount
The maximum number of files. A zero value indicates no limit is placed on the number of files.
filePrefix
The prefix for all generated file names.
fileSuffix
The suffix for all generated file names.
fileSequenceNumber
The initial file sequence number.
includeTimeStamp
The include timestamp flag.
includePidTid
The include process and thread identifiers flag.
includeCallersName
The include caller's class and method name flag.
fieldSeparator
The field separator for timestamp and other fields.

Remarks

For a description of these arguments see CyclicFileTraceListener.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace | CyclicFileTraceListener Constructor Overload List


CyclicFileTraceListener Fields

The fields of the CyclicFileTraceListener class are listed below. For a complete list of CyclicFileTraceListener class members, see the CyclicFileTraceListener Members topic.

Public Static (Shared) Fields

UNLIMITED_FILE_COUNTS Indicates no limit on the maximum number of trace files.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.UNLIMITED_FILE_COUNTS Field

Indicates no limit on the maximum number of trace files.

[Visual Basic]
Public Const UNLIMITED_FILE_COUNTS As Long = 0
[C#]
public const long UNLIMITED_FILE_COUNTS = 0;

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener Properties

The properties of the CyclicFileTraceListener class are listed below. For a complete list of CyclicFileTraceListener class members, see the CyclicFileTraceListener Members topic.

Public Instance Properties

DirectoryName | Gets the directory in which to write trace files.
FieldSeparator | Gets the field separator in the output.
FilePrefix | Gets the prefix used when forming trace file names.
FileSequenceNumber | Gets the initial file sequence number.
FileSuffix | Gets the suffix used when forming trace file names.
IncludeCallersName | Gets the flag indicating whether to include the caller's class and method name.
IncludePidTid | Gets the flag indicating whether to include the process and thread identifiers.
IncludeTimeStamp | Gets the flag indicating whether to include a timestamp.
IndentLevel (inherited from TraceListener) | Gets or sets the indent level.
IndentSize (inherited from TraceListener) | Gets or sets the number of spaces in an indent.
MaxFileCount | Gets the maximum number of trace files. A zero value indicates no limit is placed on the number of files.
MaxFileSize | Gets the maximum size of the trace files in bytes.
Name (inherited from TraceListener) | Gets or sets a name for this TraceListener.

Protected Instance Properties

NeedIndent (inherited from TraceListener) Gets or sets a value indicating whether to indent the output.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.DirectoryName Property

Gets the directory in which to write trace files.

[Visual Basic]
Public ReadOnly Property DirectoryName As String
[C#]
public string DirectoryName {get;}

Property Value

The name of the directory. The default is the current directory.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.FieldSeparator Property

Gets the field separator in the output.

[Visual Basic]
Public ReadOnly Property FieldSeparator As String
[C#]
public string FieldSeparator {get;}

Property Value

The the field separator in the output. The default is a comma.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.FilePrefix Property

Gets the prefix used when forming trace file names.

[Visual Basic]
Public ReadOnly Property FilePrefix As String
[C#]
public string FilePrefix {get;}

Property Value

The prefix used when forming trace file names. The default is no prefix.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.FileSequenceNumber Property

Gets the initial file sequence number.

[Visual Basic]
Public ReadOnly Property FileSequenceNumber As Long
[C#]
public long FileSequenceNumber {get;}

Property Value

The initial file sequence number. The default is zero.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.FileSuffix Property

Gets the suffix used when forming trace file names.

[Visual Basic]
Public ReadOnly Property FileSuffix As String
[C#]
public string FileSuffix {get;}

Property Value

The suffix used when forming trace file names. The default is ".log".

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.IncludeCallersName Property

Gets the flag indicating whether to include the caller's class and method name.

[Visual Basic]
Public ReadOnly Property IncludeCallersName As Boolean
[C#]
public bool IncludeCallersName {get;}

Property Value

The flag indicating whether to include the caller's class and method name. The default is false.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.IncludePidTid Property

Gets the flag indicating whether to include the process and thread identifiers.

[Visual Basic]
Public ReadOnly Property IncludePidTid As Boolean
[C#]
public bool IncludePidTid {get;}

Property Value

The flag indicating whether to include the process and thread identifiers. The default is false.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.IncludeTimeStamp Property

Gets the flag indicating whether to include a timestamp.

[Visual Basic]
Public ReadOnly Property IncludeTimeStamp As Boolean
[C#]
public bool IncludeTimeStamp {get;}

Property Value

The flag indicating whether to include a timestamp. The default is false.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.MaxFileCount Property

Gets the maximum number of trace files. A zero value indicates no limit is placed on the number of files.

[Visual Basic]
Public ReadOnly Property MaxFileCount As Long
[C#]
public long MaxFileCount {get;}

Property Value

The maximum number of trace files. The default is no limit on the number of trace files.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.MaxFileSize Property

Gets the maximum size of the trace files in bytes.

[Visual Basic]
Public ReadOnly Property MaxFileSize As Long
[C#]
public long MaxFileSize {get;}

Property Value

The maximum size of the trace files in bytes. The default is 64 kbytes.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener Methods

The methods of the CyclicFileTraceListener class are listed below. For a complete list of CyclicFileTraceListener class members, see the CyclicFileTraceListener Members topic.

Public Instance Methods

Close | Close the trace file.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from TraceListener) | Overloaded. Releases all resources used by the TraceListener .
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fail (inherited from TraceListener) | Overloaded. Emits an error message, and a detailed error message to the listener you create when you implement the TraceListener class.
Flush | Flush the trace file.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Write (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
Write | Overloaded. Write the message to the trace file.
WriteLine (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class, followed by a line terminator.
WriteLine | Overloaded. Write the message and a new line to the trace file.

Protected Instance Methods

Dispose | Overloaded. Releases the unmanaged resources used by the CyclicFileTraceListener and optionally releases the managed resources.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
WriteIndent (inherited from TraceListener) | Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.Close Method

Close the trace file.

[Visual Basic]
Overrides Public Sub Close()
[C#]
public override void Close();

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


Dispose Method

ComponentSpace Trace Listeners Class Library Reference

CyclicFileTraceListener.Dispose Method

Releases the unmanaged resources used by the CyclicFileTraceListener and optionally releases the managed resources.

Overload List

Inherited from TraceListener.

public void Dispose();

Releases the unmanaged resources used by the CyclicFileTraceListener and optionally releases the managed resources.

protected override void Dispose(bool);

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.Dispose Method (Boolean)

Releases the unmanaged resources used by the CyclicFileTraceListener and optionally releases the managed resources.

[Visual Basic]
Overrides Overloads Protected Sub Dispose( _
ByVal disposing As Boolean _
)
[C#]
protected override void Dispose(
bool disposing
);

Parameters

disposing
true to release both managed and unmanaged resources; false to release only unmanaged resources

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace | CyclicFileTraceListener.Dispose Overload List


CyclicFileTraceListener.Flush Method

Flush the trace file.

[Visual Basic]
Overrides Public Sub Flush()
[C#]
public override void Flush();

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


Write Method

ComponentSpace Trace Listeners Class Library Reference

CyclicFileTraceListener.Write Method

Write the message to the trace file.

Overload List

Inherited from TraceListener.

public virtual void Write(object);

Inherited from TraceListener.

public virtual void Write(object,string);

Write the message to the trace file.

public override void Write(string);

Inherited from TraceListener.

public virtual void Write(string,string);

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.Write Method (String)

Write the message to the trace file.

[Visual Basic]
Overrides Overloads Public Sub Write( _
ByVal message As String _
)
[C#]
public override void Write(
string message
);

Parameters

message
The message to write.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace | CyclicFileTraceListener.Write Overload List


WriteLine Method

ComponentSpace Trace Listeners Class Library Reference

CyclicFileTraceListener.WriteLine Method

Write the message and a new line to the trace file.

Overload List

Inherited from TraceListener.

public virtual void WriteLine(object);

Inherited from TraceListener.

public virtual void WriteLine(object,string);

Write the message and a new line to the trace file.

public override void WriteLine(string);

Inherited from TraceListener.

public virtual void WriteLine(string,string);

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace


CyclicFileTraceListener.WriteLine Method (String)

Write the message and a new line to the trace file.

[Visual Basic]
Overrides Overloads Public Sub WriteLine( _
ByVal message As String _
)
[C#]
public override void WriteLine(
string message
);

Parameters

message
The message to write.

See Also

CyclicFileTraceListener Class | ComponentSpace.TraceListeners Namespace | CyclicFileTraceListener.WriteLine Overload List


HttpTraceListener Class

The HttpTraceListener is a trace listener that uploads trace messages to a URL.

For a list of all members of this type, see HttpTraceListener Members.

System.Object
System.MarshalByRefObject
System.Diagnostics.TraceListener
ComponentSpace.TraceListeners.HttpTraceListener

[Visual Basic]
Public Class HttpTraceListener
Inherits TraceListener
[C#]
public class HttpTraceListener : TraceListener

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The following is an example of configuring the trace listener using the application's XML configuration file.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.diagnostics>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add
          name="HttpTraceListener"
          type="ComponentSpace.TraceListeners.HttpTraceListener,ComponentSpace.TraceListeners"
          initializeData="http://www.tracereceiver.com"/>
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>

Requirements

Namespace: ComponentSpace.TraceListeners

Assembly: ComponentSpace.TraceListeners (in ComponentSpace.TraceListeners.dll)

See Also

HttpTraceListener Members | ComponentSpace.TraceListeners Namespace


HttpTraceListener Members

HttpTraceListener overview

Public Instance Constructors

HttpTraceListener Overloaded. Initializes a new instance of the HttpTraceListener class.

Public Instance Properties

IndentLevel (inherited from TraceListener) | Gets or sets the indent level.
IndentSize (inherited from TraceListener) | Gets or sets the number of spaces in an indent.
Name (inherited from TraceListener) | Gets or sets a name for this TraceListener.
RequestUrl | Gets or sets the URL for receiving the trace messages.

Public Instance Methods

Close (inherited from TraceListener) | When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from TraceListener) | Overloaded. Releases all resources used by the TraceListener .
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fail (inherited from TraceListener) | Overloaded. Emits an error message, and a detailed error message to the listener you create when you implement the TraceListener class.
Flush (inherited from TraceListener) | When overridden in a derived class, flushes the output buffer.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Write (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
Write | Overloaded. Write the message by uploading it to the URL.
WriteLine (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class, followed by a line terminator.
WriteLine | Overloaded. Write the message and a new line by uploading it to the URL.

Protected Instance Properties

NeedIndent (inherited from TraceListener) Gets or sets a value indicating whether to indent the output.

Protected Instance Methods

Dispose (inherited from TraceListener) | Overloaded. Releases the unmanaged resources used by the TraceListener and optionally releases the managed resources.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
WriteIndent (inherited from TraceListener) | Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false.

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace


HttpTraceListener Constructor

Initializes a new instance of the HttpTraceListener.

Overload List

Initializes a new instance of the HttpTraceListener.

public HttpTraceListener();

Initializes a new instance of the HttpTraceListener using the specified URL.

public HttpTraceListener(string);

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace


HttpTraceListener Constructor ()

Initializes a new instance of the HttpTraceListener.

[Visual Basic]
Overloads Public Sub New()
[C#]
public HttpTraceListener();

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace | HttpTraceListener Constructor Overload List


HttpTraceListener Constructor (String)

Initializes a new instance of the HttpTraceListener using the specified URL.

[Visual Basic]
Overloads Public Sub New( _
ByVal requestUrl As String _
)
[C#]
public HttpTraceListener(
string requestUrl
);

Parameters

requestUrl
The URL for receiving the trace messages.

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace | HttpTraceListener Constructor Overload List


HttpTraceListener Properties

The properties of the HttpTraceListener class are listed below. For a complete list of HttpTraceListener class members, see the HttpTraceListener Members topic.

Public Instance Properties

IndentLevel (inherited from TraceListener) | Gets or sets the indent level.
IndentSize (inherited from TraceListener) | Gets or sets the number of spaces in an indent.
Name (inherited from TraceListener) | Gets or sets a name for this TraceListener.
RequestUrl | Gets or sets the URL for receiving the trace messages.

Protected Instance Properties

NeedIndent (inherited from TraceListener) Gets or sets a value indicating whether to indent the output.

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace


HttpTraceListener.RequestUrl Property

Gets or sets the URL for receiving the trace messages.

[Visual Basic]
Public Property RequestUrl As String
[C#]
public string RequestUrl {get; set;}

Property Value

The URL for receiving the trace messages.

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace


HttpTraceListener Methods

The methods of the HttpTraceListener class are listed below. For a complete list of HttpTraceListener class members, see the HttpTraceListener Members topic.

Public Instance Methods

Close (inherited from TraceListener) | When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from TraceListener) | Overloaded. Releases all resources used by the TraceListener .
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fail (inherited from TraceListener) | Overloaded. Emits an error message, and a detailed error message to the listener you create when you implement the TraceListener class.
Flush (inherited from TraceListener) | When overridden in a derived class, flushes the output buffer.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Write (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
Write | Overloaded. Write the message by uploading it to the URL.
WriteLine (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class, followed by a line terminator.
WriteLine | Overloaded. Write the message and a new line by uploading it to the URL.

Protected Instance Methods

Dispose (inherited from TraceListener) | Overloaded. Releases the unmanaged resources used by the TraceListener and optionally releases the managed resources.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
WriteIndent (inherited from TraceListener) | Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false.

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace


Write Method

ComponentSpace Trace Listeners Class Library Reference

HttpTraceListener.Write Method

Write the message by uploading it to the URL.

Overload List

Inherited from TraceListener.

public virtual void Write(object);

Inherited from TraceListener.

public virtual void Write(object,string);

Write the message by uploading it to the URL.

public override void Write(string);

Inherited from TraceListener.

public virtual void Write(string,string);

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace


HttpTraceListener.Write Method (String)

Write the message by uploading it to the URL.

[Visual Basic]
Overrides Overloads Public Sub Write( _
ByVal message As String _
)
[C#]
public override void Write(
string message
);

Parameters

message
The message to write.

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace | HttpTraceListener.Write Overload List


WriteLine Method

ComponentSpace Trace Listeners Class Library Reference

HttpTraceListener.WriteLine Method

Write the message and a new line by uploading it to the URL.

Overload List

Inherited from TraceListener.

public virtual void WriteLine(object);

Inherited from TraceListener.

public virtual void WriteLine(object,string);

Write the message and a new line by uploading it to the URL.

public override void WriteLine(string);

Inherited from TraceListener.

public virtual void WriteLine(string,string);

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace


HttpTraceListener.WriteLine Method (String)

Write the message and a new line by uploading it to the URL.

[Visual Basic]
Overrides Overloads Public Sub WriteLine( _
ByVal message As String _
)
[C#]
public override void WriteLine(
string message
);

Parameters

message
The message to write.

See Also

HttpTraceListener Class | ComponentSpace.TraceListeners Namespace | HttpTraceListener.WriteLine Overload List


MsmqTraceListener Class

The MsmqTraceListener is a trace listener that writes messages to a queue.

For a list of all members of this type, see MsmqTraceListener Members.

System.Object
System.MarshalByRefObject
System.Diagnostics.TraceListener
ComponentSpace.TraceListeners.MsmqTraceListener

[Visual Basic]
Public Class MsmqTraceListener
Inherits TraceListener
[C#]
public class MsmqTraceListener : TraceListener

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The following is an example of configuring the trace listener using the application's XML configuration file.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.diagnostics>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add
          name="MsmqTraceListener"
          type="ComponentSpace.TraceListeners.MsmqTraceListener,ComponentSpace.TraceListeners"
          initializeData=".\private$\trace"/>
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>

Requirements

Namespace: ComponentSpace.TraceListeners

Assembly: ComponentSpace.TraceListeners (in ComponentSpace.TraceListeners.dll)

See Also

MsmqTraceListener Members | ComponentSpace.TraceListeners Namespace


MsmqTraceListener Members

MsmqTraceListener overview

Public Instance Constructors

MsmqTraceListener Overloaded. Initializes a new instance of the MsmqTraceListener class.

Public Instance Properties

IndentLevel (inherited from TraceListener) | Gets or sets the indent level.
IndentSize (inherited from TraceListener) | Gets or sets the number of spaces in an indent.
Name (inherited from TraceListener) | Gets or sets a name for this TraceListener.
QueueName | Gets or sets the name of the queue for writing the trace messages.

Public Instance Methods

Close (inherited from TraceListener) | When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from TraceListener) | Overloaded. Releases all resources used by the TraceListener .
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fail (inherited from TraceListener) | Overloaded. Emits an error message, and a detailed error message to the listener you create when you implement the TraceListener class.
Flush (inherited from TraceListener) | When overridden in a derived class, flushes the output buffer.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Write (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
Write | Overloaded. Write the message to the message queue.
WriteLine (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class, followed by a line terminator.
WriteLine | Overloaded. Write the message and a new line to the message queue.

Protected Instance Properties

NeedIndent (inherited from TraceListener) Gets or sets a value indicating whether to indent the output.

Protected Instance Methods

Dispose (inherited from TraceListener) | Overloaded. Releases the unmanaged resources used by the TraceListener and optionally releases the managed resources.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
WriteIndent (inherited from TraceListener) | Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false.

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace


MsmqTraceListener Constructor

Initializes a new instance of the MsmqTraceListener.

Overload List

Initializes a new instance of the MsmqTraceListener.

public MsmqTraceListener();

Initializes a new instance of the MsmqTraceListener using the specified queue name.

public MsmqTraceListener(string);

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace


MsmqTraceListener Constructor ()

Initializes a new instance of the MsmqTraceListener.

[Visual Basic]
Overloads Public Sub New()
[C#]
public MsmqTraceListener();

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace | MsmqTraceListener Constructor Overload List


MsmqTraceListener Constructor (String)

Initializes a new instance of the MsmqTraceListener using the specified queue name.

[Visual Basic]
Overloads Public Sub New( _
ByVal queueName As String _
)
[C#]
public MsmqTraceListener(
string queueName
);

Parameters

queueName
The name of the queue for writing the trace messages.

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace | MsmqTraceListener Constructor Overload List


MsmqTraceListener Properties

The properties of the MsmqTraceListener class are listed below. For a complete list of MsmqTraceListener class members, see the MsmqTraceListener Members topic.

Public Instance Properties

IndentLevel (inherited from TraceListener) | Gets or sets the indent level.
IndentSize (inherited from TraceListener) | Gets or sets the number of spaces in an indent.
Name (inherited from TraceListener) | Gets or sets a name for this TraceListener.
QueueName | Gets or sets the name of the queue for writing the trace messages.

Protected Instance Properties

NeedIndent (inherited from TraceListener) Gets or sets a value indicating whether to indent the output.

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace


MsmqTraceListener.QueueName Property

Gets or sets the name of the queue for writing the trace messages.

[Visual Basic]
Public Property QueueName As String
[C#]
public string QueueName {get; set;}

Property Value

The name of the queue for writing the trace messages.

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace


MsmqTraceListener Methods

The methods of the MsmqTraceListener class are listed below. For a complete list of MsmqTraceListener class members, see the MsmqTraceListener Members topic.

Public Instance Methods

Close (inherited from TraceListener) | When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from TraceListener) | Overloaded. Releases all resources used by the TraceListener .
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fail (inherited from TraceListener) | Overloaded. Emits an error message, and a detailed error message to the listener you create when you implement the TraceListener class.
Flush (inherited from TraceListener) | When overridden in a derived class, flushes the output buffer.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Write (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
Write | Overloaded. Write the message to the message queue.
WriteLine (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class, followed by a line terminator.
WriteLine | Overloaded. Write the message and a new line to the message queue.

Protected Instance Methods

Dispose (inherited from TraceListener) | Overloaded. Releases the unmanaged resources used by the TraceListener and optionally releases the managed resources.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
WriteIndent (inherited from TraceListener) | Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false.

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace


Write Method

ComponentSpace Trace Listeners Class Library Reference

MsmqTraceListener.Write Method

Write the message to the message queue.

Overload List

Inherited from TraceListener.

public virtual void Write(object);

Inherited from TraceListener.

public virtual void Write(object,string);

Write the message to the message queue.

public override void Write(string);

Inherited from TraceListener.

public virtual void Write(string,string);

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace


MsmqTraceListener.Write Method (String)

Write the message to the message queue.

[Visual Basic]
Overrides Overloads Public Sub Write( _
ByVal message As String _
)
[C#]
public override void Write(
string message
);

Parameters

message
The message to write.

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace | MsmqTraceListener.Write Overload List


WriteLine Method

ComponentSpace Trace Listeners Class Library Reference

MsmqTraceListener.WriteLine Method

Write the message and a new line to the message queue.

Overload List

Inherited from TraceListener.

public virtual void WriteLine(object);

Inherited from TraceListener.

public virtual void WriteLine(object,string);

Write the message and a new line to the message queue.

public override void WriteLine(string);

Inherited from TraceListener.

public virtual void WriteLine(string,string);

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace


MsmqTraceListener.WriteLine Method (String)

Write the message and a new line to the message queue.

[Visual Basic]
Overrides Overloads Public Sub WriteLine( _
ByVal message As String _
)
[C#]
public override void WriteLine(
string message
);

Parameters

message
The message to write.

See Also

MsmqTraceListener Class | ComponentSpace.TraceListeners Namespace | MsmqTraceListener.WriteLine Overload List


SmtpTraceListener Class

The SmtpTraceListener is a trace listener that emails messages.

For a list of all members of this type, see SmtpTraceListener Members.

System.Object
System.MarshalByRefObject
System.Diagnostics.TraceListener
ComponentSpace.TraceListeners.SmtpTraceListener

[Visual Basic]
Public Class SmtpTraceListener
Inherits TraceListener
[C#]
public class SmtpTraceListener : TraceListener

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

The following is an example of configuring the trace listener using the application's XML configuration file.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.diagnostics>
    <trace autoflush="true" indentsize="4">
      <listeners>
        <add
          name="SmtpTraceListener"
          type="ComponentSpace.TraceListeners.SmtpTraceListener,ComponentSpace.TraceListeners"
          initializeData="fromAddress='tracesource@mycompany.com',
                          toAddress='tracedest@mycompany.com',
                          subject='trace',
                          mailServer='mail.mycompany.com'"/>
      </listeners>
    </trace>
  </system.diagnostics>
</configuration>

Requirements

Namespace: ComponentSpace.TraceListeners

Assembly: ComponentSpace.TraceListeners (in ComponentSpace.TraceListeners.dll)

See Also

SmtpTraceListener Members | ComponentSpace.TraceListeners Namespace


SmtpTraceListener Members

SmtpTraceListener overview

Public Instance Constructors

SmtpTraceListener Overloaded. Initializes a new instance of the SmtpTraceListener class.

Public Instance Properties

FromAddress | Gets or sets the email from address.
IndentLevel (inherited from TraceListener) | Gets or sets the indent level.
IndentSize (inherited from TraceListener) | Gets or sets the number of spaces in an indent.
Name (inherited from TraceListener) | Gets or sets a name for this TraceListener.
SmtpServer | Gets or sets the name of the SMTP mail server to use to send all e-mail messages.
Subject | Gets or sets the subject line.
ToAddress | Gets or sets the email to address.

Public Instance Methods

Close (inherited from TraceListener) | When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from TraceListener) | Overloaded. Releases all resources used by the TraceListener .
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fail (inherited from TraceListener) | Overloaded. Emits an error message, and a detailed error message to the listener you create when you implement the TraceListener class.
Flush (inherited from TraceListener) | When overridden in a derived class, flushes the output buffer.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Write (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
Write | Overloaded. Write the message by sending an email message.
WriteLine (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class, followed by a line terminator.
WriteLine | Overloaded. Write the message and a new line by sending an email message.

Protected Instance Properties

NeedIndent (inherited from TraceListener) Gets or sets a value indicating whether to indent the output.

Protected Instance Methods

Dispose (inherited from TraceListener) | Overloaded. Releases the unmanaged resources used by the TraceListener and optionally releases the managed resources.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
WriteIndent (inherited from TraceListener) | Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace


SmtpTraceListener Constructor

Initializes a new instance of the SmtpTraceListener.

Overload List

Initializes a new instance of the SmtpTraceListener.

public SmtpTraceListener();

Initializes a new instance of the SmtpTraceListener using the supplied initialization data.

public SmtpTraceListener(string);

Initializes a new instance of the SmtpTraceListener using the supplied parameters.

public SmtpTraceListener(string,string,string,string);

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace


SmtpTraceListener Constructor ()

Initializes a new instance of the SmtpTraceListener.

[Visual Basic]
Overloads Public Sub New()
[C#]
public SmtpTraceListener();

Remarks

The from address defaults to trace@trace.com, the subject line defaults to "trace".

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace | SmtpTraceListener Constructor Overload List


SmtpTraceListener Constructor (String)

Initializes a new instance of the SmtpTraceListener using the supplied initialization data.

[Visual Basic]
Overloads Public Sub New( _
ByVal initializeData As String _
)
[C#]
public SmtpTraceListener(
string initializeData
);

Parameters

initializeData
The initialization data.

Remarks

The initialization data consists of zero of more comma separated properties. The property names and valid values are: fromAddress is the from email address eg. fromAddress="me@mycompany.com"; toAddress is the to email address eg. toAddress="trace@mycompany.com"; subject is the subject line eg. subject="trace". mailServer is the name of the SMTP mail server eg. subject="mail.mycompany.com".

String values may either be enclosed in "double quotation marks" or 'single quotation marks' using XML entity references where required.

The toAddress is not optional. The fromAddress defaults to trace@trace.com. The subject defaults to trace. The mailServer defaults to using the local SMTP mail server.

This constructor receives the initialization data configured in the application's XML configuration file.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace | SmtpTraceListener Constructor Overload List


SmtpTraceListener Constructor (String, String, String, String)

Initializes a new instance of the SmtpTraceListener using the supplied parameters.

[Visual Basic]
Overloads Public Sub New( _
ByVal fromAddress As String, _
ByVal toAddress As String, _
ByVal subject As String, _
ByVal mailServerName As String _
)
[C#]
public SmtpTraceListener(
string fromAddress,
string toAddress,
string subject,
string mailServerName
);

Parameters

fromAddress
The email from address.
toAddress
The email to address.
subject
The email subject line.
mailServerName
The name of the SMTP mail server.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace | SmtpTraceListener Constructor Overload List


SmtpTraceListener Properties

The properties of the SmtpTraceListener class are listed below. For a complete list of SmtpTraceListener class members, see the SmtpTraceListener Members topic.

Public Instance Properties

FromAddress | Gets or sets the email from address.
IndentLevel (inherited from TraceListener) | Gets or sets the indent level.
IndentSize (inherited from TraceListener) | Gets or sets the number of spaces in an indent.
Name (inherited from TraceListener) | Gets or sets a name for this TraceListener.
SmtpServer | Gets or sets the name of the SMTP mail server to use to send all e-mail messages.
Subject | Gets or sets the subject line.
ToAddress | Gets or sets the email to address.

Protected Instance Properties

NeedIndent (inherited from TraceListener) Gets or sets a value indicating whether to indent the output.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace


SmtpTraceListener.FromAddress Property

Gets or sets the email from address.

[Visual Basic]
Public Property FromAddress As String
[C#]
public string FromAddress {get; set;}

Property Value

The email from address. The default is the trace@trace.com.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace


SmtpTraceListener.SmtpServer Property

Gets or sets the name of the SMTP mail server to use to send all e-mail messages.

[Visual Basic]
Public Property SmtpServer As String
[C#]
public string SmtpServer {get; set;}

Property Value

The name of the SMTP mail server to use to send all e-mail messages. The default is the local SMTP mail server.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace


SmtpTraceListener.Subject Property

Gets or sets the subject line.

[Visual Basic]
Public Property Subject As String
[C#]
public string Subject {get; set;}

Property Value

The subject line. The default is trace.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace


SmtpTraceListener.ToAddress Property

Gets or sets the email to address.

[Visual Basic]
Public Property ToAddress As String
[C#]
public string ToAddress {get; set;}

Property Value

The email to address.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace


SmtpTraceListener Methods

The methods of the SmtpTraceListener class are listed below. For a complete list of SmtpTraceListener class members, see the SmtpTraceListener Members topic.

Public Instance Methods

Close (inherited from TraceListener) | When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output.
CreateObjRef (inherited from MarshalByRefObject) | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.
Dispose (inherited from TraceListener) | Overloaded. Releases all resources used by the TraceListener .
Equals (inherited from Object) | Determines whether the specified Object is equal to the current Object.
Fail (inherited from TraceListener) | Overloaded. Emits an error message, and a detailed error message to the listener you create when you implement the TraceListener class.
Flush (inherited from TraceListener) | When overridden in a derived class, flushes the output buffer.
GetHashCode (inherited from Object) | Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
GetLifetimeService (inherited from MarshalByRefObject) | Retrieves the current lifetime service object that controls the lifetime policy for this instance.
GetType (inherited from Object) | Gets the Type of the current instance.
InitializeLifetimeService (inherited from MarshalByRefObject) | Obtains a lifetime service object to control the lifetime policy for this instance.
ToString (inherited from Object) | Returns a String that represents the current Object.
Write (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class.
Write | Overloaded. Write the message by sending an email message.
WriteLine (inherited from TraceListener) | Overloaded. Writes a category name and the value of the object's ToString method to the listener you create when you implement the TraceListener class, followed by a line terminator.
WriteLine | Overloaded. Write the message and a new line by sending an email message.

Protected Instance Methods

Dispose (inherited from TraceListener) | Overloaded. Releases the unmanaged resources used by the TraceListener and optionally releases the managed resources.
Finalize (inherited from Object) | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
MemberwiseClone (inherited from Object) | Creates a shallow copy of the current Object.
WriteIndent (inherited from TraceListener) | Writes the indent to the listener you create when you implement this class, and resets the NeedIndent property to false.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace


Write Method

ComponentSpace Trace Listeners Class Library Reference

SmtpTraceListener.Write Method

Write the message by sending an email message.

Overload List

Inherited from TraceListener.

public virtual void Write(object);

Inherited from TraceListener.

public virtual void Write(object,string);

Write the message by sending an email message.

public override void Write(string);

Inherited from TraceListener.

public virtual void Write(string,string);

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace


SmtpTraceListener.Write Method (String)

Write the message by sending an email message.

[Visual Basic]
Overrides Overloads Public Sub Write( _
ByVal message As String _
)
[C#]
public override void Write(
string message
);

Parameters

message
The message to write.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace | SmtpTraceListener.Write Overload List


WriteLine Method

ComponentSpace Trace Listeners Class Library Reference

SmtpTraceListener.WriteLine Method

Write the message and a new line by sending an email message.

Overload List

Inherited from TraceListener.

public virtual void WriteLine(object);

Inherited from TraceListener.

public virtual void WriteLine(object,string);

Write the message and a new line by sending an email message.

public override void WriteLine(string);

Inherited from TraceListener.

public virtual void WriteLine(string,string);

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace


SmtpTraceListener.WriteLine Method (String)

Write the message and a new line by sending an email message.

[Visual Basic]
Overrides Overloads Public Sub WriteLine( _
ByVal message As String _
)
[C#]
public override void WriteLine(
string message
);

Parameters

message
The message to write.

See Also

SmtpTraceListener Class | ComponentSpace.TraceListeners Namespace | SmtpTraceListener.WriteLine Overload List


ComponentSpace.TraceListenersHierarchy

ComponentSpace Trace Listeners Class Library Reference

ComponentSpace.TraceListeners Hierarchy

System.Object
System.MarshalByRefObject
System.Diagnostics.TraceListener ---- System.IDisposable
ComponentSpace.TraceListeners.CyclicFileTraceListener
ComponentSpace.TraceListeners.HttpTraceListener
ComponentSpace.TraceListeners.MsmqTraceListener
ComponentSpace.TraceListeners.SmtpTraceListener

See Also

ComponentSpace.TraceListeners Namespace