diff --git a/CHANGELOG.md b/CHANGELOG.md index 920544da..35730ec0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Fixed +- Used metric instead of log to improve efficiency ## [3.0.2] - 2021-09-22 diff --git a/dotnet/DataSources/ProductReviewRepository.cs b/dotnet/DataSources/ProductReviewRepository.cs index 2e4e7e42..b227ad74 100644 --- a/dotnet/DataSources/ProductReviewRepository.cs +++ b/dotnet/DataSources/ProductReviewRepository.cs @@ -83,7 +83,7 @@ public async Task> GetProductReviewsAsync(string productId) //_context.Vtex.Logger.Info("GetProductReviewsAsync", null, $"[{response.StatusCode}] {responseContent}"); if (response.StatusCode == HttpStatusCode.NotFound) { - _context.Vtex.Logger.Info("GetProductReviewsAsync", null, $"[{response.StatusCode}] {responseContent}"); + _context.Vtex.Logger.Metric("GetProductReviewsAsyncNotFound", 1, new (string, string)[]{("ProductId", productId)}); return null; } } @@ -304,7 +304,7 @@ public async Task ValidateKeyAndToken(string key, string token, string bas } else { - _context.Vtex.Logger.Info("ValidateKeyAndToken", null, $"[{response.StatusCode}]"); + _context.Vtex.Logger.Metric("ValidateKeyAndToken", 1, new []{("StatusCode", response.StatusCode.ToString())}); } } catch (Exception ex)