Comments (15)
Ask your favorite Odoo programmer to quote this new feature for you, and let them do it if you like their offer
from server-tools.
Hi Wim,
If you do not need to log everything starting from a specific method, you can control the log creation with the context key auditlog_disabled
. Auditlog itself uses it to not log its own operations (https://github.com/OCA/server-tools/blob/8.0/auditlog/models/rule.py#L213).
Another feature I would like to add is to choose the log level for each rule:
- Full log: make a snapshot of the data before/after the CRUD operation and logs the difference, as it is now. It is slow, but even computed fields are logged if they change.
- Fast log: just log the
vals
dictionary forwrite
andcreate
operations. There is no snapshot of the data before/after, so it should be very fast.
from server-tools.
Thanks, Sébastien, I'll change my own module for auditlog_disabled.
I like fast log feature (certainly for some of the models), would it be a big change to the existing module?
About the full log and computed fields, do you mean that also not-stored computed fields are logged?
from server-tools.
@wim-a technically, he does a read()
on all records twice, so yes, if you have expensive computed fields, they are probably the culprit. If you have control over the code and are not interested in the computed fields anyways during logging, check for the context key @sebalix mentions in your function and do nothing then.
Make sure you use a version with #301 (merged to main branch three weeks ago) merged, this eases the pain already a lot in some cases.
The fast log sounds like a very good idea, I don't think that costs more than a couple of hours to implement.
from server-tools.
Thanks for the info, Holger. How can we proceed for having the fast log feature available?
from server-tools.
Sébastien, Holger,
I've modified the code of the auditlog module on my server for fast logging.
In this version, it works as follows:
- The auditlog_rule table has an additional field action_rule in which the system administrator can define if this model is full or fast logged.
- For each action (create, read, write, unlink), there are now 2 patch methods defined, one for full logging, and one for fast logging.
- In case of fast logging, only the vals data is written to the log line.
After making this change, and defining all of my logged models as fast logged (which is currently the default value), my own process, which was running 90 minutes with full logging, is getting back to 2 minutes (as with the auditlog module uninstalled).
I'll send you a tar file with this version of the module. If you want, you can apply these changes also in published version of the module.
Best regards,
Wim
from server-tools.
@wim-a how about a PR? It's simple, just follow steps 4 and following from https://odoo-community.org/page/code
from server-tools.
I received your tar.gz (but no time to look at it now). If you are not familiar with Git/GitHub process, I will create it later with your development.
Thank you
from server-tools.
I’m not familiar with it. It would be good that you also review the code. Maybe you want to do some things another way.
From: Sébastien Alix [mailto:[email protected]]
Sent: Wednesday, January 27, 2016 11:05 AM
To: OCA/server-tools [email protected]
Cc: Wim Audenaert [email protected]
Subject: Re: [server-tools] Odoo runs much slower with auditlog module installed (#339)
I received your tar.gz (but no time to look at it now). If you are not familiar with Git/GitHub process, I will create it later with your development.
Thank you
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/339#issuecomment-175523994.
from server-tools.
Indeed, there will be a code review, this step is mandatory to push updates to OCA modules.
from server-tools.
I didn't receive any code, but if @sebalix has it, that's good enough. You should give explicit permission to publish your code as AGPL with the OCA modifications (cf https://odoo-community.org/page/faq, heading 'Licenses & CLA'), otherwise, we can't integrate it with the standard code
from server-tools.
meanwhile, I close this issue as it seems to be resolved
from server-tools.
I give you permission to publish my code.
Best regards,
Wim
from server-tools.
@wim-a I think signing the CLA is mandatory: https://odoo-community.org/page/cla
You should considering investing few hours trying a Git PR. As a programmers these are skills that you will need sooner nor later. Remember that we are here to help.
from server-tools.
FYI #974 - auditlog - log_id on table auditlog_log_line is missing an index - DELETE WON'T FINISH due to missing index.
from server-tools.
Related Issues (20)
- A new redis session module
- [BUG][RFC] website_sale_search_fuzzy
- auditlog
- base_sequence_option - Still in alpha mode? Will it be beta in the near future?
- RFC fleshing out attachment_synchronize exports
- [16.0] upgrade_analysis : KeyError: 'module' when generating records due to patched method init_models HOT 4
- Old values are alwasy false HOT 1
- upload is disabled what can i do? HOT 1
- [16.0] Can't use base_fontawesome, not showing icons HOT 5
- Skills Survey and Slides module extend template "hr_resume_data_row" not working HOT 1
- Not always an record will be created - situation not duplicatable. HOT 1
- [15.0] auto_backup execution leaves a considerable amount of locked memory after each execution
- Enhancement request : Sentry performance monitoring HOT 1
- base_name_search_improved: can't be configured
- multi_image in product.product HOT 1
- product_multi_image odoo module
- Frontend integration for sentry HOT 1
- upgrade_analysis: Odoo-version HOT 5
- [16.0] excel_import_export: template cannot be found if it is created by duplicating another template
- Migration to version 17.0 HOT 21
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from server-tools.