API Log
api_log · OCA/rest-framework
-
Security25/25No findings
-
Activity25/25Last human commit 1 month ago
-
Required by20/252 modules depend on it
-
Maturity18/25In 3 Odoo series since 16.0
Heuristic over the facts below, not an audit · How it's computed
Description
This module allows to store request and response logs for any API.
When a response is logged, the header API_LOG_ENTRY_ID is injected in the response header.
This header stores the identifier of the log record produced from the response.
A scheduled action "API Log: Delete old logs" is available to automatically delete old API log records. It is disabled by default.
To enable it, go to Settings > Technical > Automation > Scheduled Actions and activate "API Log: Delete old logs".
The retention period (in days) is configurable through the system parameter
api_log.retention_days, which defaults to 180 days. Logs with a
request_date older than this threshold are deleted when the cron runs.
Dependencies
- Odoo dependencies
- Python dependencies
- None
- System dependencies
- None
- Required by
- api_log_mail, fastapi_log
Code analysis
Extracted from the source by best-effort static analysis (no code is executed); details may be incomplete.
Views touched 3
| XML ID | Name | Model | Type | Status |
|---|---|---|---|---|
api_log_view_form |
api.log.form | api.log | form | New |
api_log_view_search |
api.log.search | api.log | search | New |
api_log_view_tree |
api.log.list | api.log | list | New |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 2
-
collection_idIntegercompute='_compute_collection'index=Truestore=True -
collection_modelCharcompute='_compute_collection'index=Truestore=True -
collection_refReferenceselection='_selection_collection_ref' -
nameCharcompute='_compute_name'store=True -
referrerCharcompute='_compute_request_headers_derived'store=True -
request_b64Binarycompute='_compute_request_b64'string='Request Content' -
request_bodyBinaryattachment=False -
request_content_lengthIntegercompute='_compute_request_headers_derived'store=True -
request_content_typeCharcompute='_compute_request_headers_derived'store=True -
request_dateDatetimeindex=True -
request_headersJson -
request_headers_previewTextcompute='_compute_headers_preview' -
request_methodChar -
request_previewTextcompute='_compute_request_preview' -
request_timeFloat -
request_urlChar -
response_b64Binarycompute='_compute_response_b64'string='Response Content' -
response_bodyBinaryattachment=False -
response_content_lengthIntegercompute='_compute_response_headers_derived'store=True -
response_content_typeCharcompute='_compute_response_headers_derived'store=True -
response_dateDatetime -
response_headersJson -
response_headers_previewTextcompute='_compute_headers_preview' -
response_previewTextcompute='_compute_response_preview' -
response_status_codeIntegerindex=True -
response_timeFloat -
stack_traceText -
timeFloatcompute='_compute_time'store=True
-
cron_delete_logs(self)@api.model -
log_exception(self, exception) -
log_request(self, request, override_log_values=None)@api.model -
log_response(self, response)
-
log_idsOne2many → api.logcomodel_name='api.log'compute='_compute_log_ids'string='Logs' -
log_requestsBooleanhelp='Log requests in database.'
-
action_logs(self)
Loading…
Loading…