Skip to content

Tcp lost message #115

Open
Open
@CwjXFH

Description

@CwjXFH

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions