示例#1
0
 protected override async Task WriteLogAsync(MetricLog Log)
 {
     if (_metricWriter != null)
     {
         await _metricWriter.WriteLineAsync($"\"{Log.Timestamp:o}\",\"{Log.CorrelationId.ToString().ToUpper()}\",\"{Log.ItemId}\",\"{Log.MetricName}\",\"{Log.DateTimeValue?.ToString("o")}\",\"{Log.IntValue}\",\"{Log.TextValue}\"");
     }
 }
 protected override async Task WriteLogAsync(MetricLog Log)
 {
     if (_hostId.HasValue && _processId.HasValue)
     {
         using (var connection = await _database.OpenConnectionAsync(_connection))
         {
             var queryParameters = new
             {
                 HostId = _hostId.Value,
                 ProcessId = _processId.Value,
                 Log.Timestamp,
                 CorrelationId = Log.CorrelationId.ToString().ToUpper(),
                 Log.ItemId,
                 Log.MetricName,
                 Log.DateTimeValue,
                 Log.IntValue,
                 Log.TextValue
             };
             await connection.ExecuteAsync(_sqlInsertMetricLogs, queryParameters);
         }
     }
 }
示例#3
0
 protected abstract Task WriteLogAsync(MetricLog Log);