This project has moved and is read-only. For the latest updates, please go here.

Integrate wlog in your application using Nlog

Download Wlog client library and include it in your poject as reference. This library uses "Newtonsoft Json.Net" library and NLog, so if your project dont use yet you'll have to add.

After that you have to change configuration settings as below:
<nlog xmlns="" xmlns:xsi="" throwExceptions="true" >
      <add assembly="NLog.WebLog"/>
      <target xsi:type="BufferingWrapper"
        <target  xsi:type="WebTarget"  destination="http://localhost:55044/api/log"
             layout="${longdate}|${level:uppercase=true}|${logger}|${message}"  />
      <logger name="wlog.loggerWithBuffer" minlevel="Info" writeTo="wlog.loggerWithBuffer"  />      

Note that in this example we use only our target; it is useful to log also in a local file appender to avoid to lost logs in case of network issues.

Param in target:

  • ApplicationKey="{8C075ED0-45A7-495A-8E09-3A98FD6E8248}" : use guid of your application; this is the guid of preconfigured sample application
  • destination="http://localhost:55044/api/log": it's the url of you serve api, change accordlyung with your server

Last edited Dec 20, 2015 at 10:07 AM by zeppaman, version 2