コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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);
        }