You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Web Api running on Azure web app
.NET Framework 4.7
Serilog 2.5.0
Serilog.Sinks.RollingFile 3.3.0
Serilog.Sinks.PeriodicBatching 2.1.1
Serilog.Sinks.Http 4.2.0
Endpoint is a custom log storage api.
Step 2: Describe the problem
I have noticed the sink is sending HttpContent with an empty body to the HttpClient. Digging a bit deeper I see that, in HttpLogShipper.OnTick(), ReadPayload is always called and creates an empty payload when the end of file is reached. The code that follows will send the payload every 2 minutes (due to nextRequiredLevelCheckUtc), even if the payload is empty.
Is this behaviour by design (sending empty bodies)? If yes, why should the endpoint accept empty bodies?
Observed results
Sink is sending requests to the configured endpoint with empty bodies. Resulting in my case a response 400 Bad Request.
Expected results
Sink does not attempt to send anything unless there are events to dispatch to the endpoint.
The text was updated successfully, but these errors were encountered:
Great, thanks! If you have trouble reproducing, let me know and I'll share more about my use case.
I am using a custom HttpClient wrapper and textFormatter. The HttpClient wrapper adds authentication and executes a PUT instead of a POST. The textFormatter is the same as the NormalTextFormatter but adds a field specific for my usecase. The batchFormatter is the DefaultBatchFormatter.
Step 1: Describe your environment
Web Api running on Azure web app
.NET Framework 4.7
Serilog 2.5.0
Serilog.Sinks.RollingFile 3.3.0
Serilog.Sinks.PeriodicBatching 2.1.1
Serilog.Sinks.Http 4.2.0
Endpoint is a custom log storage api.
Step 2: Describe the problem
I have noticed the sink is sending HttpContent with an empty body to the HttpClient. Digging a bit deeper I see that, in HttpLogShipper.OnTick(), ReadPayload is always called and creates an empty payload when the end of file is reached. The code that follows will send the payload every 2 minutes (due to nextRequiredLevelCheckUtc), even if the payload is empty.
Is this behaviour by design (sending empty bodies)? If yes, why should the endpoint accept empty bodies?
Observed results
Sink is sending requests to the configured endpoint with empty bodies. Resulting in my case a response 400 Bad Request.
Expected results
Sink does not attempt to send anything unless there are events to dispatch to the endpoint.
The text was updated successfully, but these errors were encountered: