---
title: "Comment by Azhar Abbas on \"MCP Logging That Redacts PII Before It Hits the Log\" | Hashnode"
description: "Redacting the object before it's serialized makes sense, since regex on a flattened string always misses something. I'd also add a test that feeds known card an"
url: "https://hashnode.com/posts/mcp-logging-that-redacts-pii/6af90a81f4f6a176e536a553/comment/6af936e3395ea94396ac6e22"
---

[Discussion](https://hashnode.com/posts/mcp-logging-that-redacts-pii/6af90a81f4f6a176e536a553)

Comment [MCP Logging That Redacts PII Before It Hits the Log](https://hashnode.com/posts/mcp-logging-that-redacts-pii/6af90a81f4f6a176e536a553)

[Azhar Abbas](https://hashnode.com/@azharabbas)

[Nov 15](https://hashnode.com/posts/mcp-logging-that-redacts-pii/6af90a81f4f6a176e536a553/comment/6af936e3395ea94396ac6e22)

Redacting the object before it's serialized makes sense, since regex on a flattened string always misses something. I'd also add a test that feeds known card and email samples through the logger and fails the build if any unmasked value shows up in the output.
