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!

#6

Sorry for the late reply. This slipped my mind.
Are you using the .NET Standard library or the regular .NET 4.x library?

#7

I am using .NET Standard library for asp.net core, and WPF application.

#8

Hi Jonas,
Do you have any update on this?
Please do let me know if you need any other info that I can provide.

Thanks,
Phi

#9

I’ve done several attempts to be able to reproduce it without success.

The only time I didn’t get it working was when the log4net.config didnt include

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

Can you create a sample application where you have reproduced the error?

#10

Hi Jonas,
Sorry for a late response.
So I downloaded the demo from your NLog library (https://github.com/coderrio/Coderr.Client.NLog), and update the server url, key, and secret and run the demos.
The Coderr.Client.NLog.Demo.Net452 project will log the error to Coderr server just fine. But Coderr.Client.NLog.Demo project which is .net core project will not log at all.

This is a screenshot of a successful error log that works only for Full .Net Framework.

I am using Visual Studio 2017. Please let me know if there anything else I can provides.
Thanks again for looking into this.