Logging in database

by
Odoo          
v 12.0 Third Party 795
Download for 12.0 series Deploy on Odoo.sh
You bought this module and need support ? Click here !
Technical name smile_log
LicenseAGPL-3
Websitehttp://www.smile.fr
Repositoryhttps://github.com/Smile-SA/odoo_addons#12.0
Read description for v 11.0 v 10.0 v 9.0 v 8.0 v 7.0 v 6.1 v 6.0

Logging in database

License: AGPL-3 Smile-SA/odoo_addons

This module adds a logs handler writing to database.

Notice

  • Following code will create a log in db with a unique pid per logger:
    import logging logger = SmileLogger(dbname, model_name, res_id, uid) logger.info(your_message)

Features :

  • Create logs when executing an action.
  • Archive and delete old logs from database.
  • Give users access right to see logs.

Table of contents

Configuration

  • Developer adds import logging to his python file.
  • Developer must add following code to his action and specify the database, the model name, the res_id, and uid. Then give a message to log for information:
logger = SmileLogger(dbname, model_name, res_id, uid)
logger.info(your_message)
  • Administrator must create a Scheduled Action to call the function archive_and_delete_old_logs, configure archiving path and the number of days to archive and delete logs.

Usage

To add Logs handler to an action :

  1. Import SmileDBLogger to your python code and add code lines as shown in following example :

    Import SmileDBLogger
  2. Add smile_log to your module dependence:

    Depends manifest
  3. Now execute the action.:

    Button validate
  4. Go to Settings > Technical > Logging> Logs menu to see logs.

    Logs

Administrator can give access right to users, to see logs, by checking Smile Logs / User.

Smile Logs
To create the scheduled action:
  1. Go to Settings > Technical > Automation > Scheduled Actions and fill fields as follow:

    Schedules Action

    (Make sure that the given folder has a write access!)

  2. After running the action, the extracted logs file in csv format is as shown in next figure:

    Smile Logs

Bug Tracker

Bugs are tracked on GitHub 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 here.

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

GDPR / EU Privacy

This addons does not collect any data and does not set any browser cookies.

Credits

Authors

  • Corentin POUHET-BRUNERIE
  • Xavier FERNANDEZ
  • Majda EL MARIOULI

Maintainer

This module is maintained by the Smile SA.

Since 1991 Smile has been a pioneer of technology and also the European expert in open source solutions.

Smile SA

This module is part of the odoo-addons project on GitHub.

You are welcome to contribute.

Please log in to comment on this module