odoo日志文件中的时区不正确 [英] timezone incorrect in odoo log file
问题描述
在我所在的国家/地区,时区为GMT + 5.30,因此我在首选项菜单中相应地更改了时区,但在odoo日志文件中,时区仍为GMT.如何更改此时间?
In my country timezone is GMT+5.30,so I changed the timezone accordingly in preferences menu but in odoo log file the timezone is still GMT.How to change this?
配置文件
[options]
; This is the password that allows database operations:
; admin_passwd = admin
db_host = localhost
db_port = 5432
db_maxconn = 64
db_name = False
db_user = openpg
db_password = openpgpwd
addons_path = C:\Users\odooGit\addons
pg_path = C:\Program Files (x86)\OpenERP 7.0-20150922\PostgreSQL\bin
xmlrpc = True
xmlrpc_port = 8069
xmlrpcs = True
xmlrpcs_port = 8071
syslog = True
推荐答案
此功能目前在Odoo中不可用,即使您将时区设置为Africa/Lagos
之类,Odoo也会将UTC
时间用于日志,如果您使用的是Linux,请使用--syslog
启动odoo服务器的解决方法,该方法将使用计算机的时区,就像处理其他系统日志一样.
This feature isn't available in Odoo at the moment even if you set timezone to something like Africa/Lagos
Odoo will use UTC
time for the logs, if you're on Linux a workaround to start the odoo server with --syslog
, which would uses the machine's timezone just like it does for other system logs.
所以像这样启动您的Odoo服务器
so start your Odoo server like this
./odoo.py --syslog
或者您可以通过以下方式在配置文件中进行设置:
or you can just set it in the config file with
syslog = True
请注意,指定--syslog
会将日志重定向到将日志重定向到系统日志文件(通常为var/log/syslog
),如果要使用单独的文件,则必须自己做一些额外的工作.
Note that specifying --syslog
will redirect the logs to the redirect the logs to the system log files (usually var/log/syslog
), if you want a separate file, you'll have to do some extra work yourself.
如果您使用Ubuntu结帐/etc/rsyslog.d/50-default.conf
(rsyslogd)
if you're on Ubuntu checkout /etc/rsyslog.d/50-default.conf
(rsyslogd)
如果您使用的是使用syslogd checkout /etc/syslog.conf
if you're on CentOS which uses syslogd checkout /etc/syslog.conf
这篇关于odoo日志文件中的时区不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!