Control request and response logging for outgoing service calls by enabling the Communication Log setting for individual services. When enabled, this feature logs request and response details including headers. This feature provides enhanced visibility into external service communications and helps you validate authentication headers and troubleshoot integration issues.
You can now enable request and response logging for outgoing HTTP client calls with automatic redaction of sensitive data. This feature logs complete request and response details including headers, making it especially useful for validating custom authentication headers and troubleshooting third-party service integrations.
The dw.net.HTTPClientLoggingConfig class now provides greater control over
logging behavior and sensitive data redaction. You configure which fields, headers, and data
patterns should be redacted to protect sensitive information like passwords, credit card numbers,
and authentication tokens. Logging only occurs when both Business Manager settings and API
configurations are enabled.
Where: This feature applies to B2C Commerce.
How: In your script code, configure logging with the
HTTPClientLoggingConfig class. You must specify sensitive fields to redact or
logging will be skipped. For example:
var httpClient = new dw.net.HTTPClient();
var config = new dw.net.HTTPClientLoggingConfig();
// Enable logging
config.setEnabled(true);
config.setLevel("INFO");
// Configure sensitive data redaction (required for logging to occur)
config.setSensitiveHeaders(["authorization", "x-api-key"]);
config.setSensitiveJsonFields(["password", "creditCard"]);
config.setSensitiveXmlFields(["password", "creditCard"]);
// Apply configuration
httpClient.setLoggingConfig(config);
// Make your HTTP call
httpClient.open('GET', 'https://api.example.com/endpoint');
httpClient.send();
If you configured your code as a service, in Business Manager, navigate to , select the service, and enable Communication Log Enabled.