Azure App Insights — как добавить настраиваемое свойство в настраиваемые события в статистике приложений с помощью serilog?
Пользовательское свойство не найдено в вышестоящих классах (промежуточное ПО, уровень API) после его передачи в нижестоящий класс (уровень инфраструктуры), как показано ниже.
public async Task<T> GetFromCacheAsync<T>(string key) where T: class
{
var stopwatch = Stopwatch.StartNew();
var cachedResponse = await _distributedCache.GetStringAsync(key);
if (string.IsNullOrEmpty(cachedResponse)) { return null; }
LogContext.PushProperty(IS_CACHED_RESPONSE, "True");
Log.Information($"Fetched the response from azure cache for redis with Cache Key: {key} in Time: {stopwatch.Elapsed}");
return JsonConvert.DeserializeObject<T>(cachedResponse);
}