Skip to content

Commit

Permalink
Use metric instead of logs to reduce log volume
Browse files Browse the repository at this point in the history
  • Loading branch information
Athos Couto committed Sep 24, 2021
1 parent f987608 commit 1cc1ce9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dotnet/DataSources/ProductReviewRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public async Task<IList<Review>> 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;
}
}
Expand Down Expand Up @@ -298,7 +298,7 @@ public async Task<bool> 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)
Expand Down

0 comments on commit 1cc1ce9

Please sign in to comment.