Skip to content

[17.0][MIG] rest_log: Migration to 17.0 #523

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: 17.0
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ exclude: |
^fastapi_auth_jwt/|
^fastapi_auth_jwt_demo/|
^model_serializer/|
^rest_log/|
# END NOT INSTALLABLE ADDONS
# Files and folders generated by bots, to avoid loops
^setup/|/static/description/index\.html$|
Expand Down
89 changes: 48 additions & 41 deletions rest_log/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
REST Log
========

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:f93e58dbd77af1254adb0cd7ace54af0b0609569883ed4a22028f11f0b663139
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
Expand All @@ -14,26 +17,26 @@ REST Log
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github
:target: https://github.com/OCA/rest-framework/tree/15.0/rest_log
:target: https://github.com/OCA/rest-framework/tree/17.0/rest_log
:alt: OCA/rest-framework
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/rest-framework-15-0/rest-framework-15-0-rest_log
:target: https://translation.odoo-community.org/projects/rest-framework-17-0/rest-framework-17-0-rest_log
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/271/15.0
:alt: Try me on Runbot
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/rest-framework&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|
|badge1| |badge2| |badge3| |badge4| |badge5|

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.
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.
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.

**Table of contents**

Expand All @@ -44,44 +47,48 @@ Configuration
=============

Logs retention
~~~~~~~~~~~~~~
--------------

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.
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.

The Logs menu is shown only with Developer tools (``?debug=1``) activated.
The Logs menu is shown only with Developer tools (``?debug=1``)
activated.

By default, REST logs are kept 30 days.
You can change the duration of the retention by changing the System Parameter
By default, REST logs are kept 30 days. You can change the duration of
the retention by changing the System Parameter
``rest.log.retention.days``.

If the value is set to 0, the logs are not stored at all.

Logged data is: request URL and method, parameters, headers, result or error.

Logged data is: request URL and method, parameters, headers, result or
error.

Logs activation
~~~~~~~~~~~~~~~
---------------

You have 2 ways to activate logging:

* on the service component set `_log_calls_in_db = True`
* via configuration
- on the service component set \_log_calls_in_db = True
- via configuration

In the 1st case, calls will be always be logged.

In the 2nd case you can set ``rest.log.active`` param as::
In the 2nd case you can set ``rest.log.active`` param as:

::

`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)
`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)

Changelog
=========

13.0.1.0.0
~~~~~~~~~~
----------

First official version.

Expand All @@ -90,37 +97,37 @@ Bug Tracker

Bugs are tracked on `GitHub Issues <https://github.com/OCA/rest-framework/issues>`_.
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
`feedback <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**>`_.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/rest-framework/issues/new?body=module:%20rest_log%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~
-------

* Camptocamp
* ACSONE

Contributors
~~~~~~~~~~~~
------------

* Guewen Baconnier <[email protected]>
* Simone Orsi <[email protected]>
- Guewen Baconnier <[email protected]>
- Simone Orsi <[email protected]>

Other credits
~~~~~~~~~~~~~
-------------

**Financial support**

* Cosanum
* Camptocamp R&D
* ACSONE R&D
- Cosanum
- Camptocamp R&D
- ACSONE R&D

Maintainers
~~~~~~~~~~~
-----------

This module is maintained by the OCA.

Expand All @@ -140,6 +147,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-simahawk|

This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/15.0/rest_log>`_ project on GitHub.
This module is part of the `OCA/rest-framework <https://github.com/OCA/rest-framework/tree/17.0/rest_log>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 1 addition & 2 deletions rest_log/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{
"name": "REST Log",
"summary": "Track REST API calls into DB",
"version": "15.0.1.0.0",
"version": "17.0.1.0.0",
"development_status": "Beta",
"website": "https://github.com/OCA/rest-framework",
"author": "Camptocamp, ACSONE, Odoo Community Association (OCA)",
Expand All @@ -20,5 +20,4 @@
"views/rest_log_views.xml",
"views/menu.xml",
],
"installable": False,
}
Loading
Loading