Higher log level for a particular REST message

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2023 05:27 AM
Hi,
I need to change the log level to 'All' instead of the default 'Basic' for a particular REST message triggered from a Business Rule. How can I do that? I do not want to change log levels for all outbound requests. Only for this particular Business Rule.
Best regards
Thomas
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-18-2023 05:51 AM
Hi,
The configuration of setting log level is for API level, we cannot set it for specific BR.
You can use script to log request and response payloads and same can be found in system logs.
Something like below:
var requestBody = request.getRequestBody();
var httpStatus = response.getStatusCode();
var responseBody = response.getBody();
gs.info("API Request Body " + requestBody + ' Status:' + httpStatus, 'Source Name to find logs');
gs.info("API Response Body " + responseBody, 'Source Name to find logs');
Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande
Thanks
Anil Lande