6

在旧版本中,日志存档是默认设置,它会每天存档(将旧日志 mv 到不同的日志文件)并保存一周左右的存档。现在在 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
4

2 回答 2

4

似乎logrotate参数按我的需要工作。起初我没有注意到它,也许不是整个 24 小时还没有过去或者(需要一些时间来归档日志)。但现在我看到它每天都归档日志。

于 2014-09-30T10:00:41.657 回答
1

请注意,由于 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

于 2021-07-16T10:11:12.783 回答