1

I've been asked to add to my current Serilog sinks also Logz.io(I never used it), I normally use Seq from DataLust.

Here's my configuration part

  {
        "Name": "LogzIo",
        "Args": {
          "authToken": "sometoken",
          "dataCenterSubDomain": "listener",
          "dataCenter": {
            "subDomain": "listener",
            "useHttps": true
          },
          "logEventsInBatchLimit": 5000,
          "period": "00:00:02",
          "restrictedToMinimumLevel": "Debug",
          "lowercaseLevel": false,
          "environment": "",
          "serviceName": ""
        }
      },

But I've not seen this log to be pushed. what I saw is on my mvc applicaiton I've got a file called Buffer-20230412.txt which contains the log informations.

How can I set it up so that logs are almost sent immediately?

Thanks

advapi
  • 3,661
  • 4
  • 38
  • 73

1 Answers1

0

In my experience, one error in a request will cause the entire batch to fail, and then subsequent batches as the buffer is continually retried.

To prove this, you should see a build up of Buffer-... files, as they fill up.

To triage, you'll need to enable the SelfLog and then check the file it produces.

If you see a line like below, then there's a malformed line which will need to be cleared before the rest will go through.

2023-06-26T00:14:17.9440519Z Received failed HTTP shipping result BadRequest: {"malformedLines":1,"oversizedLines":0,"successfulLines":999}

If you don't care too much about missing logs for a short period, just delete all the buffer files and then they'll flow through again.

Ideally of course, we need to fix the root issue, if you have a low enough volume of logs, you should be able to see in the buffer file which is the offending line and fix it in source.

John B
  • 1,129
  • 14
  • 23