REST Log
rest_log · OCA/rest-framework
-
Security25/25No findings
-
Activityn/aNo commit data
-
Required by5/250 modules depend on it
-
Maturity25/25In 9 Odoo series since 10.0
Heuristic over the facts below, not an audit · How it's computed
Migration considerations
- Raw `cr.execute()` INSERT/UPDATE/DELETE bypasses the ORM (no compute/constrains/tracking/mail): `INSERT INTO rest_log ( request_url, request_method, params, headers, result, error, exception_name, exception_message, state, severity, create_uid, create_date, write_uid, write_date ) SELECT request_url, request_method, params, headers, result, error, exception_name, exception_message, state, severity, create_uid, create_date, write_uid, write_date FROM shopfloor_log;` - re-check the table/column names still match after upgrading. (2 occurrences in this file) migration-raw-sql-write · source
Migration review checklist, not a compatibility verdict. "Migrating to X.0" applies once you upgrade to that version; "Since X.0" means this version already ignores or rejects that code. Methodology
Description
When exposing REST services is often useful to see what's happening especially in case of errors.
This module add DB logging for REST requests. It also inject in the response the URL of the log entry created.
NOTE: this feature was implemented initially inside shopfloor app. Up to version 13.0.1.2.1 of this module, if shopfloor is installed, log records will be copied from its table.
Dependencies
- Odoo dependencies
- Python dependencies
- apispec, cerberus, parse-accept-language, pyquerystring
- System dependencies
- None
- Required by
- None
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 |
|---|---|---|---|---|
rest_log_form_view |
rest.log form | rest.log | form | New |
rest_log_search_view |
rest.log search | rest.log | search | New |
rest_log_tree_view |
rest.log tree | rest.log | list | New |
HTTP endpoints 0
No HTTP endpoints found for this module.
Models touched 1
-
collectionCharindex=True -
collection_idIntegerindex=Truestring='Collection ID' -
errorTextreadonly=True -
exception_messageTextreadonly=True -
exception_nameCharreadonly=Truestring='Exception' -
headersTextreadonly=True -
paramsTextreadonly=True -
request_methodCharreadonly=True -
request_urlCharreadonly=Truestring='Request URL' -
resultTextreadonly=True -
severitySelectioncompute='_compute_severity'readonly=Falseselection=[('functional', 'Functional'), ('warning', 'Warning'), ('severe', 'Severe')]store=True -
stateSelectionreadonly=Trueselection=[('success', 'Success'), ('failed', 'Failed')]
-
action_view_collection(self)Open collection if we have a real record. NOTE: use an action instead of a `Reference` field with computed method because it would force use to have glue modules to provide a selection for every model we want to support. -
autovacuum(self)Delete logs which have exceeded their retention duration Called from a cron. -
logging_active(self)
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…
Loading…