title: Large http payloads aren't getting sent to the Serilog Http Sink endpoint in .NET Core 3.1
body: <h1>Summary</h1>
  <p>I'm having trouble posting from Serilog (Http Sink) to my custom .NET Core 3.1 WebAPI endpoint when the logging data is large. If I remove some log data when I do the logging, then Serilog sinks properly with my WebAPI endpoint.</p>
  <h1>My Configuration</h1>
  <pre><code>            new LoggerConfiguration()
                       .Enrich.FromLogContext()
                       .WriteTo.Http(httpPath, httpClient: new CustomHttpClient(), batchPostingLimit: int.MaxValue, queueLimit: int.MaxValue)
                       .CreateLogger();
  </code></pre>
  <h1>My Custom Http Client</h1>
  <pre><code>public class CustomHttpClient : IHttpClient
  {
      private readonly HttpClient c_httpClient;
  
      public CustomHttpClient()
      {
          c_httpClient = new HttpClient
          {
              MaxResponseContentBufferSize = 2147483647L
          };
      }
  
      public void Configure(IConfiguration configuration)
      {
          
      }
  
      public Task&lt;HttpResponseMessage&gt; PostAsync(string requestUri, HttpContent content) =&gt; c_httpClient.PostAsync(requestUri, content);
  
      public void Dispose() =&gt; c_httpClient?.Dispose();
  }
  </code></pre>
  <h1>What actually does the logging</h1>
  <pre><code>            var exceptionModel = new AppMonModel
              {
                  Application = &quot;SerilogMvc Sample Application&quot;,
                  Message = ex.Message,
                  Source = &quot;SerilogMvc.HomeController.Index&quot;,
                  StackTrace = ex.StackTrace,
                  InnerException = ex.InnerException?.StackTrace,
                  Details = &quot;Sample details here&quot;,
                  InsertDate = DateTime.Now,
                  Severity = 100,
                  UserDescription = &quot;Keyvan User&quot;,
                  ScreenshotBase64String = Convert.ToBase64String(System.IO.File.ReadAllBytes(&quot;C:/SamplePath/Untitled.png&quot;))
              };
              
              c_logger.LogError(ex, &quot;{exceptionModel}&quot;, exceptionModel);
  </code></pre>
  <h1>My Endpoint</h1>
  <pre><code>    [HttpPost(&quot;log&quot;)]
      [DisableRequestSizeLimit]
      public void Log([FromBody] object logEvents) { ... }
  </code></pre>
  <h1>Serilog Error</h1>
  <p>Event JSON representation exceeds the byte size limit of 262144 set for this sink and will be dropped;</p>
  <h1>Issue</h1>
  <p>When I remove <code>ScreenshotBase64String = Convert.ToBase64String(System.IO.File.ReadAllBytes(&quot;C:/SamplePath/Untitled.png&quot;))</code> from my exceptionModel object, I see the error in my WebAPI endpoint. As soon as I add it back in, it doesn't even hit the endpoint.</p>
  <p>Please let me know if you need additional details. I'd be more than glad to provide them.</p>