From 7908caf6d4e85d75907ff3351cb32c2644d88918 Mon Sep 17 00:00:00 2001 From: Athos Couto Date: Thu, 16 Sep 2021 19:08:35 -0300 Subject: [PATCH 1/2] Use metric instead of logs to reduce log volume --- dotnet/DataSources/ProductReviewRepository.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) From bc9ba7f5cb7c42a658d3db4820b5fb8c0b1c6b6c Mon Sep 17 00:00:00 2001 From: Athos Couto Date: Fri, 24 Sep 2021 10:38:23 -0300 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) 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