Skip to content

Latest commit

 

History

History
50 lines (37 loc) · 1.25 KB

README.md

File metadata and controls

50 lines (37 loc) · 1.25 KB

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>