Ads by Lake Quincy Media

Wiki Navigation

 
Gibraltar - Learn about the best analysis tool for NLog

MSMQ target

NLog documentation is currently being re-organized to use the wiki format. Some content is still missing or incomplete.
We need volunteers to help maintain and organize this Wiki. Please contact Jarek if you are interested in helping out.

Writes log message to the specified message queue handled by MSMQ. 

Supported in

Configuration Syntax

<targets>
  <target xsi:type="MSMQ"
          name="String"
          useXmlEncoding="Boolean"
          encoding="Encoding"
          layout="Layout"
          recoverable="Boolean"
          createQueueIfNotExists="Boolean"
          label="Layout"
          queue="Layout" />
</targets>
Read more about using the Configuration File.

Parameters

  • General Options
  • name - Name of the target.
  • Layout Options
  • useXmlEncoding - Indicates whether to use the XML format when serializing message.Boolean Default: False
  • encoding - Encoding to be used when writing text to the queue.Encoding
  • layout - Layout used to format log messages.Layout Required. Default: ${longdate}|${level:uppercase=true}|${logger}|${message}
  • Queue Options
  • recoverable - Indicates whether to use recoverable messages (with guaranteed delivery).Boolean Default: False
  • createQueueIfNotExists - Indicates whether to create the queue if it doesn't exists.Boolean Default: False
  • label - Label to associate with each message.Layout Default: NLog
    By default no label is associated.
  • queue - Name of the queue to write to.Layout Required.
    To write to a private queue on a local machine use .\private$\QueueName. For other available queue names, consult MSMQ documentation.
Ads by Lake Quincy Media