timezone incorrect in odoo log file

那年仲夏 提交于 2019-12-12 01:58:53

问题


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?

Config file,

[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

回答1:


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.

so start your Odoo server like this

./odoo.py --syslog

or you can just set it in the config file with

syslog = True

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.

if you're on Ubuntu checkout /etc/rsyslog.d/50-default.conf (rsyslogd)

if you're on CentOS which uses syslogd checkout /etc/syslog.conf



来源:https://stackoverflow.com/questions/38801527/timezone-incorrect-in-odoo-log-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!