Skip to content
/ NLog.MSMQ Public

NLog Target for writing to Microsoft Message Queue - MSMQ

License

Notifications You must be signed in to change notification settings

NLog/NLog.MSMQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NLog.MSMQ

NLog MSMQ Target for writing to Microsoft Message Queue (MSMQ)

Version AppVeyor

How to install

  1. Install the package

    Install-Package NLog.MSMQ or in your csproj:

    <PackageReference Include="NLog.MSMQ" Version="5.*" />
  2. Add to your nlog.config:

    <extensions>
        <add assembly="NLog.MSMQ"/>
    </extensions>

    Alternative register from code using fluent configuration API:

    LogManager.Setup().SetupExtensions(ext => {
       ext.RegisterTarget<NLog.Targets.MessageQueueTarget>();
    });

Example NLog.config file

Example of using the target "MSMQ" in nlog.config-file:

<nlog>
    <extensions>
        <add assembly="NLog.MSMQ"/>
    </extensions>
    <targets>
        <target name="msmq" xsi:type="MSMQ" layout="${message}"  />
    </targets>
    <rules>
        <logger minLevel="Info" writeTo="msmq" />
    </rules>
</nlog>