Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for .NET Core? #9

Open
mfaizanse opened this issue Dec 18, 2017 · 13 comments
Open

Support for .NET Core? #9

mfaizanse opened this issue Dec 18, 2017 · 13 comments

Comments

@mfaizanse
Copy link

Hi, my services are in .NET core, Is this sdk supported by .Net core?

@snakefoot
Copy link
Contributor

PR is ready: #8

@moriyoshi
Copy link
Member

The PR was merged. Can you take a look?

@snakefoot
Copy link
Contributor

@moriyoshi Maybe release a nuget-package ?

@snakefoot
Copy link
Contributor

snakefoot commented Feb 10, 2018

Custom NuGet-package, while waiting for the official nuget.org to be updated (net35, net40, net45 + netstandard20)

NLog.Targets.Fluentd.1.0.5.nupkg.zip (Remove zip-extension after download)

@ghost
Copy link

ghost commented Mar 17, 2018

More than a month has passed and it seems the package hasn't been updated @ Nuget. Can you please check it out? @moriyoshi

https://www.nuget.org/packages/NLog.Targets.Fluentd/

@snakefoot
Copy link
Contributor

snakefoot commented Mar 17, 2018

@kalexii I'm not the owner of the nuget-package. I just helped with updating the source-code to support NetStandard. Can you verify that the unreleased nuget-package is working for you?

@moriyoshi Maybe time to release as official nuget-package?

@ghost
Copy link

ghost commented Mar 17, 2018

@snakefoot Well, VS doesn't give me any warnings anymore. I'll follow up once I've wired everything up.
TY for the package 👍

@ghost
Copy link

ghost commented Mar 17, 2018

@snakefoot

Matter of fact, it throws some weird error. Here's an excerpt from NLog internal log:

2018-03-17 13:25:25.1298 Warn Fluentd Emit - System.IO.IOException: Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. ---> System.Net.Sockets.SocketException: An established connection was aborted by the software in your host machine
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Write(Byte[] buffer, Int32 offset, Int32 size)
   at NLog.Targets.FluentdEmitter.Emit(DateTime timestamp, String tag, IDictionary`2 data) in C:\Users\snakefoot\Source\Repos\NLog.Targets.Fluentd\src\NLog.Targets.Fluentd\Fluentd.cs:line 167
   at NLog.Targets.Fluentd.Write(LogEventInfo logEvent) in C:\Users\snakefoot\Source\Repos\NLog.Targets.Fluentd\src\NLog.Targets.Fluentd\Fluentd.cs:line 336

And here's my config:

<?xml version="1.0" encoding="utf-8"?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      autoReload="true"
      internalLogLevel="info"
      internalLogFile="c:\temp\internal-nlog.txt">
  <extensions>
    <add assembly="NLog.Targets.Fluentd" />
  </extensions>
  <targets>
    <target xsi:type="Fluentd" name="fluentd-target"
            host="host"
            port="port"
            tag="tag"
            emitStackTraceWhenAvailable="true"
            layout="${longdate}|${event-properties:item=EventId_Id}|${uppercase:${level}}|${logger}|${message} ${exception:format=tostring}|url: ${aspnet-request-url}|action: ${aspnet-mvc-action}" />
  </targets>
  <rules>
    <logger name="*" minlevel="Debug" writeTo="fluentd-target" />
  </rules>
</nlog>

That error message is rather misleading, because disabling firewall didn't help.
Running on Windows 10. If it'll can create a sample project to reproduce this, or if you have any pointers to confirmed working sample I can use, I'm all ears :)

@snakefoot
Copy link
Contributor

snakefoot commented Mar 17, 2018

Are you missing something here:

            host="host"
            port="port"

Have you tried to open a PowerShell-prompt an run this command to check if host and port can be accessed:

Test-NetConnection -Port 800 -ComputerName 192.168.1.1

Created #10 that adds some extra logging of connection configuration.

@ghost
Copy link

ghost commented Mar 17, 2018

@snakefoot I've deliberately replaced actual values with those

@snakefoot
Copy link
Contributor

snakefoot commented Mar 17, 2018

I have created a modified version of the package with support for SocketOptionName.KeepAlive and use of BufferedStream. Both are said to help against "connection was aborted"-issues.

NLog.Targets.Fluentd.1.0.6.nupkg.zip (Remove zip-extension after download)

@ALFNeT
Copy link

ALFNeT commented Oct 29, 2018

Gentle ping to @moriyoshi, would it be possible to update the official nuget package?

@chrisdecker1201
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants