Skip to content

Commit d65e3df

Browse files
authored
Merge pull request AdobeDocs#266 from oshmyheliuk/CEXT-3510
CEXT-3510: Store webhook logs in the table and show them in the Admin UI
2 parents 0604889 + 3cb3510 commit d65e3df

File tree

4 files changed

+21
-1
lines changed

4 files changed

+21
-1
lines changed
Loading
Loading

src/pages/webhooks/hooks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ You will typically need to send authorization tokens and other connection parame
3535
</hook>
3636
```
3737

38+
The `x-adobe-commerce-request-id` is added automatically to each request and is used to track the request in the system. You can filter logs by this ID to find all logs related to a specific request.
39+
3840
This example defines two headers:
3941

4042
Name | Value

src/pages/webhooks/responses.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,22 @@ An optional hook was executed with a response code other than 2xx within the sof
200200
A required hook was executed with a response code other than 2xx within the soft and hard time limits. | Add error log entry<br/>Throw an exception
201201
An optional hook is aborted due to reaching the hard timeout limit. | Add error log entry
202202
A required hook is aborted due to reaching the hard timeout limit. | Add error log entry<br/>Throw an exception
203-
The execution time of hook exceeds the soft timeout limit. | Add a notice to the error log
203+
The execution time of hook exceeds the soft timeout limit. | Add a notice to the error log
204+
205+
## Database logging
206+
207+
You can enable database logging for debugging webhooks from the Admin. You should not enable database logging in production environments, as it can affect the performance.
208+
209+
To enable database logging, navigate to **Stores** > Settings > **Configuration** > **Adobe Services** > **Webhooks** > **Database logging configuration** and set the **Enabled** option to **Yes**.
210+
211+
![Webhooks database logging configuration](../_images/webhooks/database-logging-configuration.png)
212+
213+
You can configure the minimum log level to store logs in the database and log retention time. The available log levels are `DEBUG`, `INFO`, `WARNING`, and `ERROR`.
214+
215+
The logs are cleared once per day based on the retention time.
216+
217+
When database logging is enabled, the webhook logs are stored in the `webhook_log` table. To check logs in the Admin, navigate to **System** > **Webhooks** > **Webhook Logs**.
218+
219+
![Webhooks database logging](../_images/webhooks/database-logging.png)
220+
221+
You can filter logs by multiple fields, such as webhook method, type, hook name, and request ID.

0 commit comments

Comments
 (0)