In older versions log archiving was on default and it would archive (mv older log to different log file) daily and kept archives for a week or so. Now on Odoo version 8, it puts everything on one log file and after some time it grows very big. It even takes some time to load that file. Is there a way to get old functionality in some way?
I have these lines in Odoo configuration file:
logfile = home/myuser/var/log/openerp/openerp-server.log
logrotate = True ;it seems to not do anything or I dont see what it does.
This is what I found for logging about Odoo configuration file (only for v7, so don't know how much it is relevant for v8):
# file where the server log will be stored
logfile = None
# do not rotate the logfile
logrotate = True
# Send the log to the syslog server
syslog = False
# setup a handler at LEVEL for a given PREFIX. An empty PREFIX indicates the root logger. This option can be repeated. Example: "openerp.orm:DEBUG" or "werkzeug:CRITICAL" (default: ":INFO")
log_handler = [':INFO']
# specify the level of the logging. Accepted values: info, debug_rpc, warn, test, critical, debug_sql, error, debug, debug_rpc_answer, notset
log_level = info
It seems logrotate
parameter works how I needed. At first I didn't notice it, maybe not whole 24h were not passed yet or (some time needed to archive log). But now I see it archives logs daily.
Note that since Odoo 13, logrotate
is no longer handled in Odoo itself.
Source: https://github.com/odoo/odoo/pull/29073
You have to setup another log rotation depending on your system.
On linux, one way to do it is by using logrotate, here is a script (for distributions based on apt, but should be easy to adapt)
https://github.com/ventor-tech/odoo-install-script/blob/main/logrotate.sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With