示例#1
0
        private Task LogAsync(Exception ex, int startTime)
        {
            return(Task.Run(() =>
            {
                var errorTransactionLog = new Transaction
                {
                    Environment = ApplicationEnvironment,
                    Version = Version,
                    ResponseCode = "Error",
                    IsSuccess = false,
                    TransactionDate = DateTime.Now,
                    Metric = new Metric
                    {
                        ConsecutiveHitCount = FailureHitCount,
                        TotalExecution = Environment.TickCount - startTime
                    },
                    Exception = ex
                };

                _esClient.IndexAsync(errorTransactionLog);
            }));
        }
示例#2
0
        private async Task <object> LogAsync(Transaction transaction)
        {
            var res = await _esClient.IndexAsync(transaction);

            return(res);
        }