Skip to content
Health
88/100
good
  • Security25/25
    No findings
  • Activity25/25
    Last human commit 1 month ago
  • Required by20/25
    2 modules depend on it
  • Maturity18/25
    In 3 Odoo series since 16.0

Heuristic over the facts below, not an audit · How it's computed

Security findings
Grave / minor (static analysis)
Required by
2
Modules depending on it
External deps
0 pip · 0 bin
Python packages / system binaries
License
AGPL-3
No conflicts with its dependencies
Folder size
0.06 MB
Module directory on disk
Code analysis 0 migration notes 2 models 3 views 0 HTTP endpoints

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
odoo/odoo:
- web
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 IDNameModelTypeStatus
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

New fields (28)
  • collection_id Integer
    compute='_compute_collection' index=True store=True
  • collection_model Char
    compute='_compute_collection' index=True store=True
  • collection_ref Reference
    selection='_selection_collection_ref'
  • name Char
    compute='_compute_name' store=True
  • referrer Char
    compute='_compute_request_headers_derived' store=True
  • request_b64 Binary
    compute='_compute_request_b64' string='Request Content'
  • request_body Binary
    attachment=False
  • request_content_length Integer
    compute='_compute_request_headers_derived' store=True
  • request_content_type Char
    compute='_compute_request_headers_derived' store=True
  • request_date Datetime
    index=True
  • request_headers Json
  • request_headers_preview Text
    compute='_compute_headers_preview'
  • request_method Char
  • request_preview Text
    compute='_compute_request_preview'
  • request_time Float
  • request_url Char
  • response_b64 Binary
    compute='_compute_response_b64' string='Response Content'
  • response_body Binary
    attachment=False
  • response_content_length Integer
    compute='_compute_response_headers_derived' store=True
  • response_content_type Char
    compute='_compute_response_headers_derived' store=True
  • response_date Datetime
  • response_headers Json
  • response_headers_preview Text
    compute='_compute_headers_preview'
  • response_preview Text
    compute='_compute_response_preview'
  • response_status_code Integer
    index=True
  • response_time Float
  • stack_trace Text
  • time Float
    compute='_compute_time' store=True
Public methods (4)
  • cron_delete_logs(self)
    @api.model
  • log_exception(self, exception)
  • log_request(self, request, override_log_values=None)
    @api.model
  • log_response(self, response)

New fields (2)
  • log_ids One2many → api.log
    comodel_name='api.log' compute='_compute_log_ids' string='Logs'
  • log_requests Boolean
    help='Log requests in database.'
Public methods (1)
  • action_logs(self)

Loading…

Loading…