Last post Apr 22, 2020 07:14 AM by Sherry Chen
Apr 21, 2020 09:54 AM|MuqadarAli|LINK
I am trying to implement solution in asp.net core 3. I need to make few private properties REDACTED for security purposes while logging into file. As JsonDocument is readonly and I cannot use JsonPath as well, I
have shifted to NewtonSoft for this purpose and use JObject.Parse. My concerns are:
How much it will affect my performance?
Will it lead to memory leaks?
var requestTokens = JObject.Parse(requestBodyText); // parse request/response
foreach (string property in RedactedFields) //for each redacted field in list
JToken token = requestTokens.SelectToken(property); // apply jsonpath
if (token != null)
// jsonpath found
((Newtonsoft.Json.Linq.JValue)token).Value = "******REDACTED******";
Apr 21, 2020 11:18 AM|mgebhard|LINK
Run a load test. That's what load test are for. Keep in mind, only you know what 'high usage" means.
Apr 22, 2020 07:14 AM|Sherry Chen|LINK
You could refer to the below official documentations about Memory management and Debug a memory leak in .NET Core