1
Vote

Using LogReceiverService with targets async="true" floods the receiver service

description

Using version 2.1 of Nlog.
I have the following config in my app. Using Fiddler I noticed that I had 14 calls to http://vision.local.com/webservice/nlogreceiver.svc/binarylogger per second. If I set async to false I get calls only when I log an error.

The flooding occurs right after the following line in my code:
_logger = LogManager.GetCurrentClassLogger();

while I am still on my app's login screen so nothing has even happened yet. Is this a bug? Has anyone else seen this?

<targets async="true">
  <!-- add your targets here -->
  <target name="infofile" 
          xsi:type="File" 
          fileName="${basedir}/Logs/infolog.log"
          archiveEvery="Day"
          maxArchiveFiles="30"
          archiveFileName="${basedir}/Logs/archives/infolog.{#}.log"
          archiveNumbering="Date"
          archiveDateFormat="yyyyMMdd"
          concurrentWrites="false"/>
  <target name="errorfile"
          xsi:type="File" 
          fileName="logs/Errorlog.txt"
          archiveEvery="Day"
          maxArchiveFiles="30"
          archiveNumbering="Date"
          archiveDateFormat="yyyyMMdd"
          archiveFileName="${basedir}/Logs/archives/Errorlog.{#}.log"

          concurrentWrites="false"/>

  <target xsi:type="LogReceiverService"
        name="LogReceiver"
        endpointAddress="http://vision.local.com/webservice/nlogreceiver.svc/binarylogger"
        useBinaryEncoding="true"
        includeEventProperties="true"
        clientId="${machinename}">
    <parameter name="message" type="System.String" layout="${message}"/>
    <parameter name="logger" type="System.String" layout="${logger}"/>
    <parameter name="level" type="System.String" layout="${level}"/>
    <parameter name="client" type="System.String" layout="${machinename}"/>
  </target>>
</targets>

<rules>
  <!-- add your logging rules here -->
  <logger name="*" maxlevel="Info" writeTo="infofile" />
  <logger name="*" minlevel="Warn" writeTo="errorfile" />
  <logger name="*" minlevel="Error" writeTo="LogReceiver" />

</rules>
</nlog>

comments