Class MsmqTraceListener
- 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
stringThe name of the new instance.
queuePath
stringThe path to the queue to deliver to.
formatter
ILogFormatterThe 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
stringThe name of the new instance.
queuePath
stringThe path to the queue to deliver to.
formatter
ILogFormatterThe formatter to use.
messagePriority
MessagePriorityThe priority for the messages to send.
recoverable
boolThe recoverable flag for the messages to send.
timeToReachQueue
TimeSpanThe timeToReachQueue for the messages to send.
timeToBeReceived
TimeSpanThe timeToBeReceived for the messages to send.
useAuthentication
boolThe useAuthentication flag for the messages to send.
useDeadLetterQueue
boolThe useDeadLetterQueue flag for the messages to send.
useEncryption
boolThe useEncryption flag for the messages to send.
transactionType
MessageQueueTransactionTypeThe 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
stringThe name of the new instance.
queuePath
stringThe path to the queue to deliver to.
formatter
ILogFormatterThe formatter to use.
messagePriority
MessagePriorityThe priority for the messages to send.
recoverable
boolThe recoverable flag for the messages to send.
timeToReachQueue
TimeSpanThe timeToReachQueue for the messages to send.
timeToBeReceived
TimeSpanThe timeToBeReceived for the messages to send.
useAuthentication
boolThe useAuthentication flag for the messages to send.
useDeadLetterQueue
boolThe useDeadLetterQueue flag for the messages to send.
useEncryption
boolThe useEncryption flag for the messages to send.
transactionType
MessageQueueTransactionTypeThe System.Messaging.MessageQueueTransactionType for the message to send.
msmqInterfaceFactory
IMsmqSendInterfaceFactoryThe 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
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
TraceEventCacheThe context information provided by System.Diagnostics.
source
stringThe name of the trace source that delivered the trace data.
eventType
TraceEventTypeThe type of event.
id
intThe id of the event.
data
objectThe data to trace.
Write(string)
Writes the specified message to the message queue.
public override void Write(string message)
Parameters
message
stringMessage to be written.
WriteLine(string)
Writes the specified message to the message queue.
public override void WriteLine(string message)
Parameters
message
string