Skip to content

Commit c3258c6

Browse files
committed
[DOC] rest_log: update readme
1 parent 5c63cd9 commit c3258c6

4 files changed

Lines changed: 79 additions & 34 deletions

File tree

rest_log/README.rst

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
.. image:: https://odoo-community.org/readme-banner-image
2-
:target: https://odoo-community.org/get-involved?utm_source=readme
3-
:alt: Odoo Community Association
4-
51
========
62
REST Log
73
========
@@ -17,7 +13,7 @@ REST Log
1713
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
1814
:target: https://odoo-community.org/page/development-status
1915
:alt: Beta
20-
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
2117
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
2218
:alt: License: LGPL-3
2319
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github
@@ -38,6 +34,10 @@ especially in case of errors.
3834
This module add DB logging for REST requests. It also inject in the
3935
response the URL of the log entry created.
4036

37+
It can also enable profiling for selected REST endpoints. When profiling
38+
is active, the request execution is wrapped by Odoo's profiler and
39+
results are stored in ``ir_profile``.
40+
4141
NOTE: this feature was implemented initially inside shopfloor app. Up to
4242
version 13.0.1.2.1 of this module, if shopfloor is installed, log
4343
records will be copied from its table.
@@ -88,6 +88,22 @@ In the 2nd case you can set ``rest.log.active`` param as:
8888
`collection_name.usage.endpoint` # enable for specific endpoints
8989
`collection_name*:state` # enable only for specific state (success, failed)
9090

91+
Profiling
92+
---------
93+
94+
Profiling is enabled per endpoint and per user via system parameters:
95+
96+
- ``rest.log.profiling.conf``: same matching syntax as
97+
``rest.log.active``
98+
- ``rest.log.profiling.uid``: comma-separated list of user ids allowed
99+
to profile
100+
101+
When both parameters match, the request execution is wrapped in Odoo's
102+
profiler and the results are stored in ``ir_profile``.
103+
104+
``base.profiling_enabled_until`` is only needed to view speedscope
105+
output in the UI. It is not required to record profiles.
106+
91107
Changelog
92108
=========
93109

rest_log/readme/CONFIGURE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,16 @@ In the 2nd case you can set `rest.log.active` param as:
3030
`collection_name.usage` # enable for specific endpoints
3131
`collection_name.usage.endpoint` # enable for specific endpoints
3232
`collection_name*:state` # enable only for specific state (success, failed)
33+
34+
## Profiling
35+
36+
Profiling is enabled per endpoint and per user via system parameters:
37+
38+
- `rest.log.profiling.conf`: same matching syntax as `rest.log.active`
39+
- `rest.log.profiling.uid`: comma-separated list of user ids allowed to profile
40+
41+
When both parameters match, the request execution is wrapped in Odoo's
42+
profiler and the results are stored in `ir_profile`.
43+
44+
`base.profiling_enabled_until` is only needed to view speedscope output
45+
in the UI. It is not required to record profiles.

rest_log/readme/DESCRIPTION.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ especially in case of errors.
44
This module add DB logging for REST requests. It also inject in the
55
response the URL of the log entry created.
66

7+
It can also enable profiling for selected REST endpoints. When profiling is
8+
active, the request execution is wrapped by Odoo's profiler and results are
9+
stored in `ir_profile`.
10+
711
NOTE: this feature was implemented initially inside shopfloor app. Up to
812
version 13.0.1.2.1 of this module, if shopfloor is installed, log
913
records will be copied from its table.

rest_log/static/description/index.html

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
55
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6-
<title>README.rst</title>
6+
<title>REST Log</title>
77
<style type="text/css">
88

99
/*
@@ -360,25 +360,23 @@
360360
</style>
361361
</head>
362362
<body>
363-
<div class="document">
363+
<div class="document" id="rest-log">
364+
<h1 class="title">REST Log</h1>
364365

365-
366-
<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367-
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368-
</a>
369-
<div class="section" id="rest-log">
370-
<h1>REST Log</h1>
371366
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
372367
!! This file is generated by oca-gen-addon-readme !!
373368
!! changes will be overwritten. !!
374369
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375370
!! source digest: sha256:1149568a02aa9975271ddee0f11ef624385750bef50e4b92f44ab55de7680496
376371
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377-
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/rest-framework/tree/18.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 image-reference" href="https://translation.odoo-community.org/projects/rest-framework-18-0/rest-framework-18-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 image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
372+
<p><a class="reference external image-reference" 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 image-reference" 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 image-reference" href="https://github.com/OCA/rest-framework/tree/18.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 image-reference" href="https://translation.odoo-community.org/projects/rest-framework-18-0/rest-framework-18-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 image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378373
<p>When exposing REST services is often useful to see what’s happening
379374
especially in case of errors.</p>
380375
<p>This module add DB logging for REST requests. It also inject in the
381376
response the URL of the log entry created.</p>
377+
<p>It can also enable profiling for selected REST endpoints. When profiling
378+
is active, the request execution is wrapped by Odoo’s profiler and
379+
results are stored in <tt class="docutils literal">ir_profile</tt>.</p>
382380
<p>NOTE: this feature was implemented initially inside shopfloor app. Up to
383381
version 13.0.1.2.1 of this module, if shopfloor is installed, log
384382
records will be copied from its table.</p>
@@ -388,26 +386,27 @@ <h1>REST Log</h1>
388386
<li><a class="reference internal" href="#configuration" id="toc-entry-1">Configuration</a><ul>
389387
<li><a class="reference internal" href="#logs-retention" id="toc-entry-2">Logs retention</a></li>
390388
<li><a class="reference internal" href="#logs-activation" id="toc-entry-3">Logs activation</a></li>
389+
<li><a class="reference internal" href="#profiling" id="toc-entry-4">Profiling</a></li>
391390
</ul>
392391
</li>
393-
<li><a class="reference internal" href="#changelog" id="toc-entry-4">Changelog</a><ul>
394-
<li><a class="reference internal" href="#section-1" id="toc-entry-5">13.0.1.0.0</a></li>
392+
<li><a class="reference internal" href="#changelog" id="toc-entry-5">Changelog</a><ul>
393+
<li><a class="reference internal" href="#section-1" id="toc-entry-6">13.0.1.0.0</a></li>
395394
</ul>
396395
</li>
397-
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-6">Bug Tracker</a></li>
398-
<li><a class="reference internal" href="#credits" id="toc-entry-7">Credits</a><ul>
399-
<li><a class="reference internal" href="#authors" id="toc-entry-8">Authors</a></li>
400-
<li><a class="reference internal" href="#contributors" id="toc-entry-9">Contributors</a></li>
401-
<li><a class="reference internal" href="#other-credits" id="toc-entry-10">Other credits</a></li>
402-
<li><a class="reference internal" href="#maintainers" id="toc-entry-11">Maintainers</a></li>
396+
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-7">Bug Tracker</a></li>
397+
<li><a class="reference internal" href="#credits" id="toc-entry-8">Credits</a><ul>
398+
<li><a class="reference internal" href="#authors" id="toc-entry-9">Authors</a></li>
399+
<li><a class="reference internal" href="#contributors" id="toc-entry-10">Contributors</a></li>
400+
<li><a class="reference internal" href="#other-credits" id="toc-entry-11">Other credits</a></li>
401+
<li><a class="reference internal" href="#maintainers" id="toc-entry-12">Maintainers</a></li>
403402
</ul>
404403
</li>
405404
</ul>
406405
</div>
407406
<div class="section" id="configuration">
408-
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
407+
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
409408
<div class="section" id="logs-retention">
410-
<h3><a class="toc-backref" href="#toc-entry-2">Logs retention</a></h3>
409+
<h2><a class="toc-backref" href="#toc-entry-2">Logs retention</a></h2>
411410
<p>Logs are kept in database for every REST requests made by a client
412411
application. They can be used for debugging and monitoring of the
413412
activity.</p>
@@ -421,7 +420,7 @@ <h3><a class="toc-backref" href="#toc-entry-2">Logs retention</a></h3>
421420
error.</p>
422421
</div>
423422
<div class="section" id="logs-activation">
424-
<h3><a class="toc-backref" href="#toc-entry-3">Logs activation</a></h3>
423+
<h2><a class="toc-backref" href="#toc-entry-3">Logs activation</a></h2>
425424
<p>You have 2 ways to activate logging:</p>
426425
<ul class="simple">
427426
<li>on the service component set _log_calls_in_db = True</li>
@@ -436,40 +435,54 @@ <h3><a class="toc-backref" href="#toc-entry-3">Logs activation</a></h3>
436435
`collection_name*:state` # enable only for specific state (success, failed)
437436
</pre>
438437
</div>
438+
<div class="section" id="profiling">
439+
<h2><a class="toc-backref" href="#toc-entry-4">Profiling</a></h2>
440+
<p>Profiling is enabled per endpoint and per user via system parameters:</p>
441+
<ul class="simple">
442+
<li><tt class="docutils literal">rest.log.profiling.conf</tt>: same matching syntax as
443+
<tt class="docutils literal">rest.log.active</tt></li>
444+
<li><tt class="docutils literal">rest.log.profiling.uid</tt>: comma-separated list of user ids allowed
445+
to profile</li>
446+
</ul>
447+
<p>When both parameters match, the request execution is wrapped in Odoo’s
448+
profiler and the results are stored in <tt class="docutils literal">ir_profile</tt>.</p>
449+
<p><tt class="docutils literal">base.profiling_enabled_until</tt> is only needed to view speedscope
450+
output in the UI. It is not required to record profiles.</p>
451+
</div>
439452
</div>
440453
<div class="section" id="changelog">
441-
<h2><a class="toc-backref" href="#toc-entry-4">Changelog</a></h2>
454+
<h1><a class="toc-backref" href="#toc-entry-5">Changelog</a></h1>
442455
<div class="section" id="section-1">
443-
<h3><a class="toc-backref" href="#toc-entry-5">13.0.1.0.0</a></h3>
456+
<h2><a class="toc-backref" href="#toc-entry-6">13.0.1.0.0</a></h2>
444457
<p>First official version.</p>
445458
</div>
446459
</div>
447460
<div class="section" id="bug-tracker">
448-
<h2><a class="toc-backref" href="#toc-entry-6">Bug Tracker</a></h2>
461+
<h1><a class="toc-backref" href="#toc-entry-7">Bug Tracker</a></h1>
449462
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/rest-framework/issues">GitHub Issues</a>.
450463
In case of trouble, please check there if your issue has already been reported.
451464
If you spotted it first, help us to smash it by providing a detailed and welcomed
452465
<a class="reference external" href="https://github.com/OCA/rest-framework/issues/new?body=module:%20rest_log%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
453466
<p>Do not contact contributors directly about support or help with technical issues.</p>
454467
</div>
455468
<div class="section" id="credits">
456-
<h2><a class="toc-backref" href="#toc-entry-7">Credits</a></h2>
469+
<h1><a class="toc-backref" href="#toc-entry-8">Credits</a></h1>
457470
<div class="section" id="authors">
458-
<h3><a class="toc-backref" href="#toc-entry-8">Authors</a></h3>
471+
<h2><a class="toc-backref" href="#toc-entry-9">Authors</a></h2>
459472
<ul class="simple">
460473
<li>Camptocamp</li>
461474
<li>ACSONE</li>
462475
</ul>
463476
</div>
464477
<div class="section" id="contributors">
465-
<h3><a class="toc-backref" href="#toc-entry-9">Contributors</a></h3>
478+
<h2><a class="toc-backref" href="#toc-entry-10">Contributors</a></h2>
466479
<ul class="simple">
467480
<li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li>
468481
<li>Simone Orsi &lt;<a class="reference external" href="mailto:simahawk&#64;gmail.com">simahawk&#64;gmail.com</a>&gt;</li>
469482
</ul>
470483
</div>
471484
<div class="section" id="other-credits">
472-
<h3><a class="toc-backref" href="#toc-entry-10">Other credits</a></h3>
485+
<h2><a class="toc-backref" href="#toc-entry-11">Other credits</a></h2>
473486
<p><strong>Financial support</strong></p>
474487
<ul class="simple">
475488
<li>Cosanum</li>
@@ -478,7 +491,7 @@ <h3><a class="toc-backref" href="#toc-entry-10">Other credits</a></h3>
478491
</ul>
479492
</div>
480493
<div class="section" id="maintainers">
481-
<h3><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h3>
494+
<h2><a class="toc-backref" href="#toc-entry-12">Maintainers</a></h2>
482495
<p>This module is maintained by the OCA.</p>
483496
<a class="reference external image-reference" href="https://odoo-community.org">
484497
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -493,6 +506,5 @@ <h3><a class="toc-backref" href="#toc-entry-11">Maintainers</a></h3>
493506
</div>
494507
</div>
495508
</div>
496-
</div>
497509
</body>
498510
</html>

0 commit comments

Comments
 (0)