Logging in database

by
Odoo
v 6.0 v 6.1 v 7.0 v 8.0 v 9.0 v 10.0 v 11.0 v 12.0 Third Party 1339
Download for v 10.0 Deploy on Odoo.sh
Availability
Odoo Online
Odoo.sh
On Premise
Technical Name smile_log
LicenseAGPL-3
Websitehttp://www.smile.fr
Versions 13.0 9.0 15.0 8.0 10.0 11.0 12.0 16.0 14.0 6.0 6.1 7.0
You bought this module and need support? Click here!

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 :

  1. Firstly :
  • The developer adds Smile Log to his model.
  • The developer specifies the DB, model, res_id, uid, and the message to display.
  1. Secondly :
  • The administrator does the action.
  • The administrator can see the logs saved in DB for the action.
  • The administrator can gives access right to users, to see logs, by checking Smile Logs / User.
  • The 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.

Table of contents

Usage

To add Smile Log to an action :

  1. Import SmileDBLogger to inherited action (Ex. validate button of account.invoice) :
Import SmileDBLogger
  1. Add the module to your depends in manifest :
Depends manifest
  1. Go click to your button action (button validate in our case)
Button validate
  1. Go to Settings > Technical > Logging> Logs menu.
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!)

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

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

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author, please use the developer contact information. They can usually be found in the description.
Please choose a rating from 1 to 5 for this module.