public static void SaveLogFileActualElement( this ElasticClient client, LogFileElement data, string indexName) { var indexActualResponse = client.Index(data, idx => idx.Index(indexName.GetActualLogFilesIndexName())); if (!indexActualResponse.ApiCall.Success) { throw indexActualResponse.ApiCall.OriginalException; } }
public override EventLogPosition GetLastPosition() { if (_lastEventLogFilePosition != null) { return(_lastEventLogFilePosition); } LogFileElement actualLogFileInfo = _client.GetLastLogFileElement(_system.Name, _indexName); EventLogPosition position = null; if (actualLogFileInfo != null) { position = new EventLogPosition( actualLogFileInfo.LastEventNumber, actualLogFileInfo.LastCurrentFileReferences, actualLogFileInfo.LastCurrentFileData, actualLogFileInfo.LastStreamPosition ); } _lastEventLogFilePosition = position; return(position); }