Error Log Retrieval for Webhook and Email Configuration Errors
With 24C, Merchants will be able to access error logs related to mis-configurations for functional webhooks and email templates. These error logs are stored in log files that roll over every day. Commerce Cloud stores 30 days’ worth of these logs files. The logs can be accessed through the existing Admin logging API(/ccadmin/v1/logging?type=merchantErrors). The Admin API logging endpoint executes concurrent REST requests to retrieve errors from each registered storefront server. The Admin API endpoint collates the results from the store requests and returns them as one JSON object. The API supports the below query parameters:
Parameter |
Format |
Default |
Description |
since |
ISO 8601 timestamp format OR millisecond value |
null |
The date and time to start searching from. |
until |
ISO 8601 timestamp format OR millisecond value |
null |
The date and time to search to. |
includeArchives |
boolean |
false |
Controls whether the search includes archived log files. |
numArchiveFiles |
int |
7 |
Searches the most recent N archived log files. A value of 0 searches all archived log files. |
queryText |
String |
null |
Limits the results to log entries containing the supplied query text. |
localLogs |
boolean |
false |
It returns errors from the local log file on the administration server, without calling out to the storefront servers. You can use it to retrieve errors thrown by the storefront preview, admin and agent servers. |
- Merchants can quickly identify, and address issues related to webhooks, email templates leads to faster troubleshooting and resolution of technical issues, reducing downtime and improving overall system reliability.
- Avoids the need to log an SR to troubleshoot webhook and email mis-configurations.
Steps to Enable
You don't need to do anything to enable this feature.
Tips And Considerations
- Error logs from Admin and Agent servers can be retrieved by setting the localLogs query parameter.
- Logs can be filtered using the query parameters queryText, since and until for further drill-down. Sample usages can be found below
Sample 1:
Request: GET /ccadmin/v1/logging?type=merchantErrors&queryText=webhookError
Response:
["store1": ["**** log\tThu Apr 02 07:25:08 UTC 2024\t1709807455748\t---\twebhookError : {webhookTargetId=production-calculateShipping, message=Invalid response code of 404 received for webhook calculateShipping, webhookTargetUrl=http://testurl/ccstore/v1/testExternalShippingMethods/getTwoValidItems "]}]
Sample 2:
Request: GET /ccadmin/v1/logging?type=merchantErrors&queryText=emailTemplateError
Response:
["store1": ["**** log\tWed Apr 02 07:21:08 UTC 2024\t1708500068558\t---\temailTemplateError : {emailNotificationType=Forgotten Password, siteId=siteUS, message=Syntax error in template \"forgot_password_v2/html_body.ftl\" in line 1, column 75: Lexical error: encountered \"$\" (36), after \"#\""]}]