Skip to content

Commit a609d72

Browse files
committed
Merge PR #509 into 18.0
Signed-off-by lmignon
2 parents a157bbc + 9cd7d4d commit a609d72

29 files changed

Lines changed: 2438 additions & 0 deletions

rest_log/README.rst

Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
========
2+
REST Log
3+
========
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:f93e58dbd77af1254adb0cd7ace54af0b0609569883ed4a22028f11f0b663139
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
18+
:alt: License: LGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github
20+
:target: https://github.com/OCA/rest-framework/tree/18.0/rest_log
21+
:alt: OCA/rest-framework
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/rest-framework-18-0/rest-framework-18-0-rest_log
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=18.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
When exposing REST services is often useful to see what's happening
32+
especially in case of errors.
33+
34+
This module add DB logging for REST requests. It also inject in the
35+
response the URL of the log entry created.
36+
37+
NOTE: this feature was implemented initially inside shopfloor app. Up to
38+
version 13.0.1.2.1 of this module, if shopfloor is installed, log
39+
records will be copied from its table.
40+
41+
**Table of contents**
42+
43+
.. contents::
44+
:local:
45+
46+
Configuration
47+
=============
48+
49+
Logs retention
50+
--------------
51+
52+
Logs are kept in database for every REST requests made by a client
53+
application. They can be used for debugging and monitoring of the
54+
activity.
55+
56+
The Logs menu is shown only with Developer tools (``?debug=1``)
57+
activated.
58+
59+
By default, REST logs are kept 30 days. You can change the duration of
60+
the retention by changing the System Parameter
61+
``rest.log.retention.days``.
62+
63+
If the value is set to 0, the logs are not stored at all.
64+
65+
Logged data is: request URL and method, parameters, headers, result or
66+
error.
67+
68+
Logs activation
69+
---------------
70+
71+
You have 2 ways to activate logging:
72+
73+
- on the service component set \_log_calls_in_db = True
74+
- via configuration
75+
76+
In the 1st case, calls will be always be logged.
77+
78+
In the 2nd case you can set ``rest.log.active`` param as:
79+
80+
::
81+
82+
`collection_name` # enable for all endpoints of the collection
83+
`collection_name.usage` # enable for specific endpoints
84+
`collection_name.usage.endpoint` # enable for specific endpoints
85+
`collection_name*:state` # enable only for specific state (success, failed)
86+
87+
Changelog
88+
=========
89+
90+
13.0.1.0.0
91+
----------
92+
93+
First official version.
94+
95+
Bug Tracker
96+
===========
97+
98+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/rest-framework/issues>`_.
99+
In case of trouble, please check there if your issue has already been reported.
100+
If you spotted it first, help us to smash it by providing a detailed and welcomed
101+
`feedback <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**>`_.
102+
103+
Do not contact contributors directly about support or help with technical issues.
104+
105+
Credits
106+
=======
107+
108+
Authors
109+
-------
110+
111+
* Camptocamp
112+
* ACSONE
113+
114+
Contributors
115+
------------
116+
117+
- Guewen Baconnier <guewen.baconnier@camptocamp.com>
118+
- Simone Orsi <simahawk@gmail.com>
119+
120+
Other credits
121+
-------------
122+
123+
**Financial support**
124+
125+
- Cosanum
126+
- Camptocamp R&D
127+
- ACSONE R&D
128+
129+
Maintainers
130+
-----------
131+
132+
This module is maintained by the OCA.
133+
134+
.. image:: https://odoo-community.org/logo.png
135+
:alt: Odoo Community Association
136+
:target: https://odoo-community.org
137+
138+
OCA, or the Odoo Community Association, is a nonprofit organization whose
139+
mission is to support the collaborative development of Odoo features and
140+
promote its widespread use.
141+
142+
.. |maintainer-simahawk| image:: https://github.com/simahawk.png?size=40px
143+
:target: https://github.com/simahawk
144+
:alt: simahawk
145+
146+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
147+
148+
|maintainer-simahawk|
149+
150+
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/18.0/rest_log>`_ project on GitHub.
151+
152+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

rest_log/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import models
2+
from . import components

rest_log/__manifest__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2020 Camptocamp SA (http://www.camptocamp.com)
2+
# Copyright 2021 ACSONE SA/NV (http://www.acsone.eu)
3+
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
4+
5+
{
6+
"name": "REST Log",
7+
"summary": "Track REST API calls into DB",
8+
"version": "18.0.1.0.0",
9+
"development_status": "Beta",
10+
"website": "https://github.com/OCA/rest-framework",
11+
"author": "Camptocamp, ACSONE, Odoo Community Association (OCA)",
12+
"maintainers": ["simahawk"],
13+
"license": "LGPL-3",
14+
"depends": ["base_rest"],
15+
"data": [
16+
"data/ir_config_parameter_data.xml",
17+
"data/ir_cron_data.xml",
18+
"security/groups.xml",
19+
"security/ir.model.access.csv",
20+
"views/rest_log_views.xml",
21+
"views/menu.xml",
22+
],
23+
}

rest_log/components/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import service

0 commit comments

Comments
 (0)