- APPS
- API Request Logger 18.0
| Lines of Code | 943 |
| Technical name | viin_api_request_logger |
| License | OPL-1 |
| Website | https://viindoo.com/apps/app/17.0/viin_api_request_logger |
| Read description for | v 17.0 |
| Extensions | Integration with Zalo OA |
API Request Logger
Centralized logging of API requests for debugging, analysis, and compliance in Odoo. Ideal for developers integrating external APIs.
Key Features
Built natively on Odoo/Viindoo to streamline real business operations:
Centralized logging of API requests for debugging, analysis, and compliance in Odoo
Ideal for developers integrating external APIs.
See API Request Logger in Action
See how this module solves real business problems in a working Viindoo environment.
Need help with API Request Logger?
For questions, implementation support, or consulting services, contact Viindoo.
Pre-Sales & Partnership
When contacting us, please include:
- Odoo/Viindoo version (CE/EE).
- Number of users and business scope.
- Other modules currently in use.
Technical Support
For faster troubleshooting, please provide:
- Order number or app reference.
- Odoo/Viindoo version & edition.
- Steps to reproduce the issue.
- Screenshots/logs if available.
Technical Requirement
Changes log
We continuously improve this module. Recent updates from the official Viindoo repository:
- 2026-04-14 Improved Add create_date to view.
- 2026-04-15 Improved Harden secret-safe transport logs.
- 2025-12-01 Fixed Wrong live test URLs.
- 2025-01-21 Improved Move menu to position 549 (next to Settings).
- 2025-01-20 Added New module for API request log.
Works Great With These Modules
Extend API Request Logger with complementary Viindoo apps:
Viindoo Unified Routing Framework
Unified routing engine for Odoo/Viindoo with provider-agnostic APIs for directions, distance, and travel time.
Module to_geo_routesGoogle Routes API Integration
Google Maps routing integration with unified APIs for directions, travel time, polyline, and multi-mode navigation.
Module to_geo_routes_googleHERE Routing API Integration
Enterprise-grade routing integration with HERE Maps for trucking, logistics, and precise multi-mode navigation.
Module to_geo_routes_hereMapbox Matrix API Integration
Mapbox distance matrix and routing integration for fleet, delivery, and VRP optimization via to_geo_routes.
Module to_geo_routes_mapboxSeaRoutes Ocean Routing Integration
Compute ocean routes, distances, and durations using SeaRoutes APIs within the unified to_geo_routes framework.
Module to_geo_routes_searoutesVietmap Matrix & Routing API Integration
Vietnam-focused routing and distance matrix integration with Vietmap for fleets and logistics via to_geo_routes.
Module to_geo_routes_vietmapWho Should Use This Module?
Built for teams that need this capability fully integrated into their Odoo/Viindoo stack.
Executives & Business Owners
Need clear visibility into operations and a stack that scales without bespoke development.
Operations / Department Leaders
Want to streamline daily workflows, remove manual handoffs, and keep data consistent across teams.
Implementers & Odoo Partners
Looking for production-ready Viindoo modules to deliver projects faster and at lower risk.
API Request Logger Documentation
Overview
The viin_api_request_logger module provides a framework for logging and monitoring API requests in Odoo. Designed for developers and administrators, it tracks all details of API interactions, including:
- User initiating the request
- Related model and record
- Request parameters, headers, and payload
- API response data and errors
- Request duration
Key Features
- Detailed Logging: Capture all request/response details, including errors.
- Secret-Safe Transport Logs: Sensitive header and query-string secrets are masked before being written to api.request.log.
- Error Monitoring: Automatically logs failed API requests for better debugging.
- Extensible Integration: Easily integrate with models using the provided mixins.
- User-Friendly API Log Viewer: Quickly access logs related to any model record.
- Customizable: Fully adaptable for specific business needs.
Installation
Install the module via the Odoo Apps interface or the command line:
odoo-bin -c <config_file> -i viin_api_request_logger
Configure user access rights to ensure secure access to logs.
Usage
Logging API Requests
To enable automatic logging for API requests, inherit the api.request.mixin in your model and use the make_request method. Here's an example:
class ExampleIntegration(models.AbstractModel): _name = 'example.integration' _inherit = 'api.request.mixin' def example_api_call(self): response = self.make_request( method="GET", url="https://api.example.com/data", headers={"Authorization": "Bearer <token>"}, params={"key": "value"}, res_model="example.model", res_id=1, ) return response.json()
Viewing API Logs
To allow users to view related logs, inherit the api.log.viewer.mixin in your model. This mixin provides:
- `last_api_request_log_id`: A computed field showing the most recent API log.
- `action_view_api_logs`: An action to display all related logs.
Example:
class ExampleModel(models.Model): _name = 'example.model' _inherit = 'api.log.viewer.mixin'
Logs can also be accessed via the "API Logs" menu in the Odoo interface.
Logging Guarantees
- request_headers always masks default sensitive headers such as Authorization and X-API-Key.
- request_url and name store the effective request URL, including query parameters expanded from params, with sensitive query-string values masked.
- Each outbound API call creates a single api.request.log record, including HTTP 4xx/5xx responses.
- Non-JSON responses fall back to raw response.text so HTML/plain-text vendor error pages still appear in the log.
Customizing the Logger
Override _prepare_log_values to include custom fields in the log:
def _prepare_log_values(self, method, url, headers, data, response, duration, res_model=None, res_id=None, error_message=None): values = super()._prepare_log_values(method, url, headers, data, response, duration, res_model, res_id, error_message) values.update({"custom_field": "Custom Value"}) return values
Configuration
The module works out-of-the-box but can be extended for advanced configurations.
Advanced Scenarios
- Custom Headers: Use the headers parameter in make_request to add headers such as authentication tokens.
- Sensitive Query Parameters: Override _get_sensitive_query_param_keys() to mask provider-specific secret query parameters in logged URLs.
- API Monitoring: Leverage the response_headers and response_data fields to debug or analyze responses.
- Integration with External Tools: Export logs for use with monitoring tools like ELK Stack or Datadog.
Support
For assistance, please contact Viindoo support at https://viindoo.com.
This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file).
You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one).
It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software.
The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.