Closed snakefoot closed 6 years ago
https://github.com/smashraid/NLog.Splunk/blob/f51a01c4caf31cc08cb52ffd43bfa3bbf6a36b48/NLog.Splunk/NLog.Splunk/SplunkTarget.cs#L75
When overriding this method to allow batch processing, then you need to do some extra work:
protected override void Write(AsyncLogEventInfo[] logEvents) { try { StringBuilder builder = new StringBuilder(); foreach (AsyncLogEventInfo item in logEvents) { string json = BuildLog(item.LogEvent); builder.Append(json); builder.AppendLine(); } this.WriteLogMessage(builder.ToString()); } catch (Exception ex) { foreach (AsyncLogEventInfo item in logEvents) item.Continuation(ex); // Notify error return; } foreach (AsyncLogEventInfo item in logEvents) item.Continuation(null); // Notify success }
Released v1.0.1
https://github.com/smashraid/NLog.Splunk/blob/f51a01c4caf31cc08cb52ffd43bfa3bbf6a36b48/NLog.Splunk/NLog.Splunk/SplunkTarget.cs#L75
When overriding this method to allow batch processing, then you need to do some extra work: