Skip to content

Remove default from logger processor#98

Closed
jharing-kayeghbm wants to merge 2 commits intoanypointcloud:mainfrom
jharing-kayeghbm:main
Closed

Remove default from logger processor#98
jharing-kayeghbm wants to merge 2 commits intoanypointcloud:mainfrom
jharing-kayeghbm:main

Conversation

@jharing-kayeghbm
Copy link

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.

Copilot AI review requested due to automatic review settings February 11, 2026 19:10
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.default value for the content field 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>
@mtransier
Copy link
Collaborator

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.

@jharing-kayeghbm
Copy link
Author

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.

@mtransier
Copy link
Collaborator

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

@jharing-kayeghbm
Copy link
Author

I didn't see that. I think we might just have to dismiss this as an architectural difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants