Remove default from logger processor#98
Remove default from logger processor#98jharing-kayeghbm wants to merge 2 commits intoanypointcloud:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Removes the default content expression from the logger processor schema to avoid logging request/response payloads when content is omitted.
Changes:
- Removed the
sdk.defaultvalue for thecontentfield to prevent payload logging by default.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Accept Copilot's suggestion for summary. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
I would prefer to keep the default. The standard way should be to disable content logging via the configuration. Then you have a good means for debugging by enabling content logging through configuration and without code changes. And you can configure it depending on your environment, so enable it for local testing / debugging and disable it for the higher environments. |
|
Thank you for looking at this. I was expecting this to be more or less a drop in replacement for the original JSON logger: https://github.com/mulesoft-consulting/json-logger or the salesforce community maintained https://github.com/salesforce-misc/mulesoft-json-logger, which both set the default to an empty string if I recall correctly. |
|
Yes, it is indeed a drop-in replacement for the original JSON logger. This part has not been changed for 6 years, you can see the commit where it was last touched here: mulesoft-consulting/json-logger@01c6a86#diff-6fc9566699e6a0db8a6cea5d681c80d2f6dd2fb7c8d66af5cad115be514bffff |
|
I didn't see that. I think we might just have to dismiss this as an architectural difference. |
The default for the 'content' field in the logger processor schema causes the logger to log the payload when no content is provided. This is against best practices, which recommend not logging payload. I believe that logging no content (especially since it is optional) is a better default, but I'm open to discussion regarding it.