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

Tcp lost message #115

Open
CwjXFH opened this issue Oct 16, 2024 · 0 comments
Open

Tcp lost message #115

CwjXFH opened this issue Oct 16, 2024 · 0 comments

Comments

@CwjXFH
Copy link

CwjXFH commented Oct 16, 2024

Hi,
I created an asp.net core project and wrote logs into Graylog:

using Serilog;

var builder = WebApplication.CreateBuilder(args);
builder.Logging.ClearProviders();
builder.Host.UseSerilog((context, cfg) =>
{
    cfg.ReadFrom.Configuration(context.Configuration);
});

var app = builder.Build();
await app.RunAsync();

Environment:

Dependencies Version
.NET 8
Serilog.Sinks.Graylog 3.1.1

Serilog config:

  "Serilog": {
    "MinimumLevel": {
      "Default": "Information"
    },
    "WriteTo": [
      {
        "Name": "Graylog",
        "Args": {
          "hostnameOrAddress": "82.156.64.210",
          "port": "12201",
          "transportType": "Tcp",
          "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff} {Level:u3}] [{SourceContext:l}] {Message:lj} {NewLine}{Exception}"
        }
      },
      {
        "Name": "Console",
        "Args": {
          "outputTemplate": "[{Timestamp:yyyy-MM-dd HH:mm:ss.fff} {Level:u3}] [{SourceContext:l}] {Message:lj} {NewLine}{Exception}"
        }
      }
    ]
  }

When I run the project, it prints 4 logs on the console, but only one message in Graylog:

image

But, if I debug at TcpTransport.Send, it will write more than one message into Graylog:

image

In the TcpTransportClient.Send method some messages may not be successfully sent to the network, I'm not sure.

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

1 participant