Table of Contents

Class MsmqTraceListener

Namespace
Microsoft.Practices.EnterpriseLibrary.Logging.TraceListeners
Assembly
Microsoft.Practices.EnterpriseLibrary.Logging.dll

Is a TraceListener that delivers the log entries to an Msmq instance.

[SecurityCritical]
public class MsmqTraceListener : FormattedTraceListenerBase, IDisposable
Inheritance
MsmqTraceListener
Implements
Inherited Members

Constructors

MsmqTraceListener(string, string, ILogFormatter)

Initializes a new instance of MsmqTraceListener.

public MsmqTraceListener(string name, string queuePath, ILogFormatter formatter)

Parameters

name string

The name of the new instance.

queuePath string

The path to the queue to deliver to.

formatter ILogFormatter

The formatter to use.

MsmqTraceListener(string, string, ILogFormatter, MessagePriority, bool, TimeSpan, TimeSpan, bool, bool, bool, MessageQueueTransactionType)

Initializes a new instance of MsmqTraceListener.

public MsmqTraceListener(string name, string queuePath, ILogFormatter formatter, MessagePriority messagePriority, bool recoverable, TimeSpan timeToReachQueue, TimeSpan timeToBeReceived, bool useAuthentication, bool useDeadLetterQueue, bool useEncryption, MessageQueueTransactionType transactionType)

Parameters

name string

The name of the new instance.

queuePath string

The path to the queue to deliver to.

formatter ILogFormatter

The formatter to use.

messagePriority MessagePriority

The priority for the messages to send.

recoverable bool

The recoverable flag for the messages to send.

timeToReachQueue TimeSpan

The timeToReachQueue for the messages to send.

timeToBeReceived TimeSpan

The timeToBeReceived for the messages to send.

useAuthentication bool

The useAuthentication flag for the messages to send.

useDeadLetterQueue bool

The useDeadLetterQueue flag for the messages to send.

useEncryption bool

The useEncryption flag for the messages to send.

transactionType MessageQueueTransactionType

The System.Messaging.MessageQueueTransactionType for the message to send.

MsmqTraceListener(string, string, ILogFormatter, MessagePriority, bool, TimeSpan, TimeSpan, bool, bool, bool, MessageQueueTransactionType, IMsmqSendInterfaceFactory)

Initializes a new instance of MsmqTraceListener.

public MsmqTraceListener(string name, string queuePath, ILogFormatter formatter, MessagePriority messagePriority, bool recoverable, TimeSpan timeToReachQueue, TimeSpan timeToBeReceived, bool useAuthentication, bool useDeadLetterQueue, bool useEncryption, MessageQueueTransactionType transactionType, IMsmqSendInterfaceFactory msmqInterfaceFactory)

Parameters

name string

The name of the new instance.

queuePath string

The path to the queue to deliver to.

formatter ILogFormatter

The formatter to use.

messagePriority MessagePriority

The priority for the messages to send.

recoverable bool

The recoverable flag for the messages to send.

timeToReachQueue TimeSpan

The timeToReachQueue for the messages to send.

timeToBeReceived TimeSpan

The timeToBeReceived for the messages to send.

useAuthentication bool

The useAuthentication flag for the messages to send.

useDeadLetterQueue bool

The useDeadLetterQueue flag for the messages to send.

useEncryption bool

The useEncryption flag for the messages to send.

transactionType MessageQueueTransactionType

The System.Messaging.MessageQueueTransactionType for the message to send.

msmqInterfaceFactory IMsmqSendInterfaceFactory

The factory to create the msmq interfaces.

Properties

QueuePath

Gets the path to the queue.

public string QueuePath { get; }

Property Value

string

The path to the queue.

Methods

CreateMessage(LogEntry)

Create a message from a LogEntry.

public Message CreateMessage(LogEntry logEntry)

Parameters

logEntry LogEntry

The LogEntry

Returns

Message

A System.Messaging.Message object.

TraceData(TraceEventCache, string, TraceEventType, int, object)

Sends the traced object to its final destination through a System.Messaging.MessageQueue.

public override void TraceData(TraceEventCache eventCache, string source, TraceEventType eventType, int id, object data)

Parameters

eventCache TraceEventCache

The context information provided by System.Diagnostics.

source string

The name of the trace source that delivered the trace data.

eventType TraceEventType

The type of event.

id int

The id of the event.

data object

The data to trace.

Write(string)

Writes the specified message to the message queue.

public override void Write(string message)

Parameters

message string

Message to be written.

WriteLine(string)

Writes the specified message to the message queue.

public override void WriteLine(string message)

Parameters

message string