Salesforce Commerce Cloud’s (SFCC) logs system captures important server-side information and errors as customers navigate your SFCC site. If your ecommerce store is built on Salesforce Commerce Cloud’s SiteGenesis (SG) or Storefront Reference Architecture (SFRA), Noibu’s SFCC logs integration enables you to ingest important error, warning, and fatal logs into Noibu. This gives development teams a unified view of server-side and client-side errors without needing to switch between systems.
Note: this feature is currently in beta. Beta features are still in development as we test and evaluate. They may have limited functionality and can change without notice. |
Data Collected from SFCC Logs
Salesforce Commerce Cloud records several logs types, but Noibu only ingests those that are indicative of a customer-impacting failure: error, customerror, warn, customwarn, and fatal. These logs are collected in real-time, and are retained in our systems for a full 30 days, as compared to the standard retention period for SFCC’s Business Manager Log Center.
Note that enabling this feature may potentially share customer personally identifiable information (PII), and you should ensure your site has the appropriate consent mechanisms in place. Note our Privacy Disclaimer at the bottom of this article. Once configured, the SFCC logs integration will present log data on the Logs page in Noibu, as well as in the context of session replays.
Enabling SFCC Logs Integration
At this time Noibu supports ingesting logs from SFCC stores on SiteGenesis (SG) and Storefront Reference Architecture (SFRA) architectures. Unfortunately, merchants on headless (PWA Kit) architectures are unable to use this feature.
1. Request access via your Noibu CSM
Reach out to your Noibu CSM to let them know you’d like to be added to the SFCC Logs Integration beta. Be sure to provide them with the following details:
- The domain(s) and SFCC site name(s) you wish to enable logs ingestion for
- Your SFCC store architecture (SG or SFRA)
Our team will provide you with an API token, which you can use in the following steps.
Note: if you have deployed Noibu via our SFCC cartridge, you can skip directly to Step 4 at this point. If you have not deployed Noibu using the SFCC cartridge, you will need to complete all the following steps to finish configuring the SFCC logs integration. |
2. Retrieve the SFCC Session ID
To map SFCC logs to session data in Noibu, you must configure the SFCC session ID as a custom attribute. SFCC Logs contain Truncated SessionID
entries, and Noibu can use these entries to connect session recordings to SFCC logs. This value is the first 10 digits of the dwsid
HTTP cookie. Do not confuse this with the sid
cookie.
The process here reads the SFCC session ID from the dwsid
cookie, truncating it to the first 10 characters, and stores it in the pdict
variable.
- Read the SFCC session ID from the
dwsid
cookie. By taking advantage of theapp.template.htmlHead
hook, you can capture the value and make it available from thepdict
.
exports.htmlHead = function (pdict) {
var cookies = request.getHttpCookies();
var dwsid = "";
var truncatedSessionId = "";
for (var i = 0; i < cookies.getCookieCount(); i++) {
if (cookies[i] && cookies[i].name == "dwsid") {
dwsid = cookies[i].value;
}
}
if (dwsid && !empty(dwsid)) {
truncatedSessionId = dwsid.substring(0, 10);
}
if (pdict) {
pdict.truncatedSessionId = truncatedSessionId;
}
}; - Use the
app.template.afterFooter
hook to render an ISML template.exports.afterFooter = function (pdict) {
var ISML = require("dw/template/ISML");
ISML.renderTemplate("noibu_custom_attribute");
}; - Validate that the value retrieved is correct by comparing it to the
dwsid
cookie value in the your browser's Developer tab.- Open the Developer tab, select
Application
, and clickCookies
. - Select your domain, and filter the list by typing
dwsid
. Verify that the first 10 digits of the cookie value match the value you set into thesfcc-session-id
cookie. It should look something like this:
- Open the Developer tab, select
3. Add SFCC Session ID as a Custom Attribute
Once you have access to your domain's SFCC session ID, share that value with Noibu by configuring a custom attribute through the NoibuJS SDK. The process listed here references the addCustomAttribute
function in the SDK Documentation.
Once you initialize the SDK, use the following code snippet to add sfcc-session-id
as a custom attribute on every page of your website. Please note that this snippet assumes you have already have a cookie called sfcc-session-id
that contains the first 10 symbols of the SFCC session id.
<isif condition="${pdict.truncatedSessionId}">
<script>
function checkSDKExistanceAndAddCustomAttribute(){
const sdkCheck = setInterval(() => {
if(window.NOIBUJS && window.NOIBUJS.addCustomAttribute){
clearInterval(sdkCheck);
window.NOIBUJS.addCustomAttribute("sfcc-session-id", "${pdict.truncatedSessionId}");
}
}, 3000);
}
checkSDKExistanceAndAddCustomAttribute();
</script>
</isif>
4. Enable Log Streaming in Salesforce Commerce Cloud
Following the instructions detailed here, create a log stream for Noibu in SFCC. We recommend the following settings:
Name | REQUIRED: This can be any value, e.g. “Noibu” |
Destination Type | REQUIRED: Select “Generic HTTP” from dropdown |
Endpoint URL | REQUIRED: https://firehose.data.noibu.com |
API Token | REQUIRED: To be provided by your CSM in Step 1 |
Realm | REQUIRED: Choose the SFCC realm associated to your domain in Noibu |
Edit Permission List | (this can be ignored) |
Enable Notification | (this can be ignored) |
Notification Time | (this can be ignored) |
Filters | REQUIRED: Severity = ERROR, FATAL, WARN |
OPTIONAL: Tenant Name = Logs tenant name ID from search aggregation, Multiple values are separated by comma. | |
Negative Filters | (this can be ignored) |
Parameters | (this can be ignored) |
Click the Save button to complete your Log Streaming configuration.
As you explore this feature, we encourage you to share your thoughts and feedback to help shape the final product as it moves out of beta. Learn more about how to use our Salesforce Commerce Cloud logs integration.
Privacy Disclaimer
Noibu provides log collection and monitoring services to help analyze the performance of your applications. While we implement automated masking to mask credit card numbers, logs may still contain personal data.
For customers sharing personal information (PII), a Data Processing Agreement (DPA) may be required to ensure compliance with regulatory obligations.
We take best-effort measures to prevent PII exposure but cannot guarantee the removal of all inadvertently logged data. If you do not have a DPA in place, please contact privacy@noibu.com for assistance.