serilog-sinks-graylog icon indicating copy to clipboard operation
serilog-sinks-graylog copied to clipboard

Version 3.0.1 not working

Open eogienko opened this issue 1 year ago • 7 comments

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?

eogienko avatar Jun 16 '23 12:06 eogienko

@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.

whir1 avatar Jun 19 '23 08:06 whir1

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

tzographos avatar Jun 20 '23 07:06 tzographos

@whir1 I'll try it this week

eogienko avatar Jun 20 '23 14:06 eogienko

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"
        }
      }

yyavci avatar Jul 06 '23 21:07 yyavci

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

whir1 avatar Jul 19 '23 13:07 whir1

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.

joriverm avatar Jul 27 '23 08:07 joriverm

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.

danielwertheim avatar Sep 15 '23 10:09 danielwertheim