예제 #1
0
 public async Task AddProcessedAsync(string commandType, object rawCommand)
 {
     var entity = new RiskSystemCommandsLogEntity
     {
         PartitionKey = RiskSystemCommandsLogEntity.GeneratePartitionKey(),
         CommandType  = commandType,
         RawCommand   = rawCommand?.ToJson(),
         IsError      = false,
         Message      = null
     };
     await _tableStorage.InsertAndGenerateRowKeyAsTimeAsync(entity, DateTime.UtcNow);
 }
예제 #2
0
 private async Task Insert(string level, string component, string process, string context, string type, string stack,
                           string msg, DateTime?dateTime)
 {
     var dt        = dateTime ?? DateTime.UtcNow;
     var newEntity = LogEntity.Create(level, component, process, context, type, stack, msg, dt);
     await _tableStorage.InsertAndGenerateRowKeyAsTimeAsync(newEntity, dt);
 }
예제 #3
0
        private async Task Insert(string level, string component, string process, string context, string type, string stack,
                                  string msg, DateTime?dateTime)
        {
            var dt        = dateTime ?? DateTime.UtcNow;
            var newEntity = LogEntity.Create(level, component, process, context, type, stack, msg, dt);

            if (level == "error" || level == "fatalerror")
            {
                await _errorTableStorage.InsertAndGenerateRowKeyAsTimeAsync(newEntity, dt);
            }
            if (level == "warning")
            {
                await _warningTableStorage.InsertAndGenerateRowKeyAsTimeAsync(newEntity, dt);
            }
            if (level == "info")
            {
                await _infoTableStorage.InsertAndGenerateRowKeyAsTimeAsync(newEntity, dt);
            }
        }
예제 #4
0
        private async Task Insert(string level, string component, string process, string context, string type, string stack,
                                  string msg, DateTime?dateTime)
        {
            var dt        = dateTime ?? DateTime.UtcNow;
            var newEntity = LogEntity.Create(level, component, process, context, type, stack, msg, dt);

            switch (level)
            {
            case "info":
                await _tableStorageInfo.InsertAndGenerateRowKeyAsTimeAsync(newEntity, dt);

                break;

            case "warning":
                await _tableStorageWarning.InsertAndGenerateRowKeyAsTimeAsync(newEntity, dt);

                break;

            default:
                await _tableStorageError.InsertAndGenerateRowKeyAsTimeAsync(newEntity, dt);

                break;
            }
        }
 public async Task AddLogAsync(IOperationLog logEntity)
 {
     var entity = OperationLogEntity.Create(logEntity);
     await _tableStorage.InsertAndGenerateRowKeyAsTimeAsync(entity, DateTime.UtcNow);
 }