diff --git a/src/Serilog.Sinks.Grafana.Loki/LokiSink.cs b/src/Serilog.Sinks.Grafana.Loki/LokiSink.cs index 9220138..7445252 100644 --- a/src/Serilog.Sinks.Grafana.Loki/LokiSink.cs +++ b/src/Serilog.Sinks.Grafana.Loki/LokiSink.cs @@ -134,12 +134,14 @@ private async Task OnTick() } else { - _connectionSchedule.MarkFailure(); - SelfLog.WriteLine( - "Received failure on HTTP shipping {0}: {1}", - response.StatusCode, - await response.Content.ReadAsStringAsync().ConfigureAwait(false)); + "Received failure on HTTP shipping ({0}): {1}. {2} log events will be dropped", + (int)response.StatusCode, + await response.Content.ReadAsStringAsync().ConfigureAwait(false), + _waitingBatch.Count); + + _connectionSchedule.MarkFailure(); + _waitingBatch.Clear(); break; }