在较旧的版本中,日志归档是默认的,它会每天归档(将较旧的日志保存到不同的日志文件中),并将归档保存一周左右。现在在Odoo版本8上,它将所有内容都放在一个日志文件中,一段时间后,它会变得非常大。加载该文件甚至需要一些时间。有没有办法以某种方式获得旧的功能?
我在Odoo配置文件中有以下几行:
logfile = home/myuser/var/log/openerp/openerp-server.log
logrotate = True ;it seems to not do anything or I dont see what it does.
这是我发现的关于Odoo配置文件的日志(仅适用于v7,所以不知道它与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
发布于 2014-09-30 18:00:42
似乎logrotate
参数的工作方式符合我的需要。一开始我没有注意到,可能不是整个24小时都还没有过去,或者(需要一些时间来归档日志)。但现在我看到它每天都会归档日志。
发布于 2021-07-16 18:11:13
请注意,从Odoo 13开始,logrotate
不再在Odoo本身中处理。
来源:https://github.com/odoo/odoo/pull/29073
您必须根据您的系统设置另一个日志轮换。
在linux上,一种方法是使用logrotate,这里有一个脚本(对于基于apt的发行版,但应该很容易适应)
https://github.com/ventor-tech/odoo-install-script/blob/main/logrotate.sh
https://stackoverflow.com/questions/25928519
复制相似问题