NLog Client Library


#1

I see there was Log4net client library, is it possible to add Coderr.Client.Nlog client library?
Log4net is great, but it still doesn’t support send mail and logging to database for .NET core.
Nlog support them all. Please consider this feature.
Thanks!


#2

I created a package.

Install it from nuget coderr.client.nlog.

Configuration instructions will automatically be shown.


#3

Hello Jonas,
Thanks a lot for creating this Library, I really appreciate it.

I’ve tested out and it doesn’t seems to log any exceptions to Coderr. I’ve even tried to test the Demo but no luck.

Can you help troubleshooting this issue?

Thank you!


#4

Can you post your nlog.config?

Do note that the library will only report log entries that have exceptions included.

Which version of the Coderr server do you have?


#5

I am currently using the CoderrCommunityServerV2.0.2 version, and tested out your demo project Coderr.Client.NLog.Demo on Github.

Here is the Nlog.config:

<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="[http://www.nlog-project.org/schemas/NLog.xsd](http://www.nlog-project.org/schemas/NLog.xsd)"
      xmlns:xsi="[http://www.w3.org/2001/XMLSchema-instance](http://www.w3.org/2001/XMLSchema-instance)"
      xsi:schemaLocation="[http://www.nlog-project.org/schemas/NLog.xsd](http://www.nlog-project.org/schemas/NLog.xsd) NLog.xsd"
      autoReload="true"
      throwExceptions="true"
      internalLogLevel="Trace" internalLogFile="c:\logs\nlog-internal.log">

  <extensions>
    <add assembly="Coderr.Client.Nlog"/>
  </extensions>

  <variable name="myvar" value="myvalue"/>

  <targets>
    <target xsi:type="File" name="f" fileName="C:/logs/Coderr.Demo.${shortdate}.log"

            layout="${longdate} ${uppercase:${level}} ${message}" />

    <target name="Coderr" type="Coderr"/>
  </targets>

  <rules>
    <logger name="" minlevel="Debug" writeTo="f" />_
    <logger name="" minlevel="Debug" writeTo="Coderr" />
  </rules>

</nlog>

Thanks for looking into this!