Search 1.9 billion lines of Odoo code on GitHub

rest_log

Author: Camptocamp, ACSONE, Odoo Community Association (OCA)
License: LGPL-3
Branch: 16.0
Repository: acsone/rest-framework
Dependencies: base_rest, and component
Languages: HTML (395, 28.8%), Python (626, 45.7%), XML (239, 17.4%), and reStructuredText (110, 8.0%)
Other branches: 10.0-backport-context-provider-lmi, 10.0-backport-from-14.0, 10.0-backport-rest-log, 10.0-fixrestlog-len, 13.0, 13.0-backport-base-rest-pydantic, 13.0-backport-extendable, 13.0-base_rest-cors-options, 13.0-fixcrashdesc, 14.0, 14.0-abi_master, 14.0-add-pydantic, 14.0-base-rest-pydantic-lmi, 14.0-base_res_service_add_properties-qgr, 14.0-deprecated-implicit-rest-method, 14.0-fdl_master, 14.0-fix-path-parameter-name, 14.0-fix-response-processing, 14.0-fixcrashdesc, 14.0-moz_master, 15.0, 15.0-initial, 16.0-fastapi, 16.0-mfr_fix_base_rest_missing_argument, 16.0-upgrade-pre-commit, and oca-port-pr--from-14.0-to-13.0
Other repositories: Change2improve/rest-framework, Digital5-Odoo/rest-framework, Gabinete-Digital/rest-framework, OCA/rest-framework, SeuMarco/rest-framework, akretion/rest-framework, coopiteasy/rest-framework, gastonfeng/rest-framework, gurneyalex/rest-framework, odoogap/rest-framework, simahawk/rest-framework, ursais/rest-framework, and wahello/rest-framework

<h1 class="title">REST Log</h1> <p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/rest-framework/tree/15.0/rest_log"><img alt="OCA/rest-framework" src="https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/rest-framework-15-0/rest-framework-15-0-rest_log"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/271/15.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p> <p>When exposing REST services is often useful to see what's happening especially in case of errors.</p> <p>This module add DB logging for REST requests. It also inject in the response the URL of the log entry created.</p> <p>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.</p> <p><strong>Table of contents</strong></p> <div class="contents local topic" id="contents"> <ul class="simple"> <li><a class="reference internal" href="#configuration" id="id2">Configuration</a><ul> <li><a class="reference internal" href="#logs-retention" id="id3">Logs retention</a></li> <li><a class="reference internal" href="#logs-activation" id="id4">Logs activation</a></li> </ul> </li> <li><a class="reference internal" href="#changelog" id="id5">Changelog</a></li> <li><a class="reference internal" href="#bug-tracker" id="id6">Bug Tracker</a></li> <li><a class="reference internal" href="#credits" id="id7">Credits</a><ul> <li><a class="reference internal" href="#authors" id="id8">Authors</a></li> <li><a class="reference internal" href="#contributors" id="id9">Contributors</a></li> <li><a class="reference internal" href="#other-credits" id="id10">Other credits</a></li> <li><a class="reference internal" href="#maintainers" id="id11">Maintainers</a></li> </ul> </li> </ul> </div> <a name="configuration"></a> <h2><a class="toc-backref" href="#id2">Configuration</a></h2> <a name="logs-retention"></a> <h3><a class="toc-backref" href="#id3">Logs retention</a></h3> <p>Logs are kept in database for every REST requests made by a client application. They can be used for debugging and monitoring of the activity.</p> <p>The Logs menu is shown only with Developer tools (<code>?debug=1</code>) activated.</p> <p>By default, REST logs are kept 30 days. You can change the duration of the retention by changing the System Parameter <code>rest.log.retention.days</code>.</p> <p>If the value is set to 0, the logs are not stored at all.</p> <p>Logged data is: request URL and method, parameters, headers, result or error.</p> <a name="logs-activation"></a> <h3><a class="toc-backref" href="#id4">Logs activation</a></h3> <p>You have 2 ways to activate logging:</p> <ul class="simple"> <li>on the service component set <cite>_log_calls_in_db = True</cite></li> <li>via configuration</li> </ul> <p>In the 1st case, calls will be always be logged.</p> <p>In the 2nd case you can set <code>rest.log.active</code> param as:</p> <pre> <code>`collection_name` # enable for all endpoints of the collection `collection_name.usage` # enable for specific endpoints `collection_name.usage.endpoint` # enable for specific endpoints `collection_name*:state` # enable only for specific state (success, failed)</code> </pre> <a name="changelog"></a> <h2 class="with-subtitle"><a class="toc-backref" href="#id5">Changelog</a></h2> <h2 class="section-subtitle" id="id1"><span class="section-subtitle">13.0.1.0.0</span></h2> <p>First official version.</p> <a name="bug-tracker"></a> <h2><a class="toc-backref" href="#id6">Bug Tracker</a></h2> <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/rest-framework/issues">GitHub Issues</a>. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed <a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20rest_log%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <p>Do not contact contributors directly about support or help with technical issues.</p> <a name="credits"></a> <h2><a class="toc-backref" href="#id7">Credits</a></h2> <a name="authors"></a> <h3><a class="toc-backref" href="#id8">Authors</a></h3> <ul class="simple"> <li>Camptocamp</li> <li>ACSONE</li> </ul> <a name="contributors"></a> <h3><a class="toc-backref" href="#id9">Contributors</a></h3> <ul class="simple"> <li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li> <li>Simone Orsi &lt;<a class="reference external" href="mailto:simahawk&#64;gmail.com">simahawk&#64;gmail.com</a>&gt;</li> </ul> <a name="other-credits"></a> <h3><a class="toc-backref" href="#id10">Other credits</a></h3> <p><strong>Financial support</strong></p> <ul class="simple"> <li>Cosanum</li> <li>Camptocamp R&amp;D</li> <li>ACSONE R&amp;D</li> </ul> <a name="maintainers"></a> <h3><a class="toc-backref" href="#id11">Maintainers</a></h3> <p>This module is maintained by the OCA.</p> <a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a> <p>OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p> <p><a class="reference external" href="https://github.com/simahawk"><img alt="simahawk" src="https://github.com/simahawk.png?size=40px" /></a></p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/rest-framework/tree/15.0/rest_log">OCA/rest-framework</a> project on GitHub.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>