Keeping sensitive shopper and payment data out of custom logs
Key Takeaway
Log only non-sensitive values, and filter or redact what service and HTTP client logs capture. In Custom Log Settings, a category's own level rule takes precedence over the root rule, and a logger writes only messages at or above that level.
B2C Commerce scripts can write custom log messages at different log levels. When code calls an external service, the platform can also log the full request and response. Logs help with troubleshooting, but they can capture passwords, credit card numbers, and shopper personal data. Developers keep that data out in three ways: they log only non-sensitive values, they add filtering callbacks to service definitions, and they set redaction on dw.net.HTTPClientLoggingConfig. Platform safeguards block unfiltered communication logs on production.
Who can read logs
B2C Commerce logs are stored securely, but users in the site_admin or developer roles can read them in Business Manager or over WebDAV. Keep that audience in mind when you decide what to log. Filter sensitive or private data, such as credit card numbers, so it isn't logged.