serilog-contrib / serilog-sinks-graylog

Serilog sink for graylog
MIT License
82 stars 68 forks source link

Version 3.0.1 not working #95

Open eogienko opened 1 year ago

eogienko commented 1 year ago

Code:

image

appsettings.json:

image

I had version 2.3.0 installed which worked great. Updated to 3.0.0 (3.0.1) and everything broke. Logs are not sent to Graylog. What to do?

whir1 commented 1 year ago

@eogienko Can you set SelfLog.Enable(Console.WriteLine); and write the output? In the master branch there is a test application for debugging sync, but with the current config - it works.

tzographos commented 1 year ago

Indeed, version 3.0.1 still doesn't work. Version 2.3.0 works fine.

eogienko commented 1 year ago

@whir1 I'll try it this week

yyavci commented 1 year ago

any updates? i have the same issue btw i make it work with http but it fails using udp transport type.

note; i can send logs via netcat without problem. here is working command;

echo -n '{ "version": "1.1", "host": "example.org", "short_message": "A short message", "level": 5, "_some_info": "foo" }' | nc -w0 -u 127.0.0.1 12201

and this is my appsettings WriteTo section (already added to usings);

      {
        "Name": "Graylog",
        "Args": {
          "hostnameOrAddress": "127.0.0.1",
          "port": "12201",
          "transportType": "Udp",
          "facility": "YYA"
        }
      }
whir1 commented 1 year ago

@yyavci I can't help because current version worked on our servers on udp =\

joriverm commented 1 year ago

ive come across an issue where a call to _logger.LogError causes the application to freeze and .net ends up infinitely waiting for something (this is within our global exception handler, so everything is halted/frozen).

maybe this can help point towards some fix? our settings :

"Serilog": {
  "Using": [
    "Serilog.Sinks.Debug",
    "Serilog.Sinks.Graylog"
  ],
  "MinimumLevel": "Verbose",
  "WriteTo": [
    {
      "Name": "Debug"
    }
    {
      "Name": "Graylog",
      "Args": {
        "Facility": "{redacted}",
        "HostnameOrAddress": "{redacted hostname}",
        "Port": 12205,
        "TransportType": "Udp",
        "MinimumLogEventLevel": "Error",
        "UseSsl": true
      }
    }
  ]
}

2.3 had no issues, so somewhere between 2.3 & 3.0.2 this started happening.

danielwertheim commented 1 year ago

How can you not be affected by this? https://github.com/serilog-contrib/serilog-sinks-graylog/issues/97

It blows up immediatelly, during boot. Have done my own extension method that I use instead and also removed the hard coded UDP value. Then everything seem to work fine.