调试 Weblate
Bugs can behave as application crashes or as various misbehavior. You are welcome to collect info on any such issue and submit it to the issue tracker.
调试模式
Turning on debug mode will make the exceptions show in the web browser. This is useful to debug issues in the web interface, but not suitable for a production environment because it has performance consequences and might leak private data.
In a production environment, use ADMINS
to receive e-mails containing error
reports, or configure error collection using a third-party service.
Weblate 日志
Weblate can produce detailed logs of what is going on in the background.
In the default configuration it uses syslog and that makes the log appear either in
/var/log/messages
or /var/log/syslog
(depending on your syslog
daemon configuration).
The Celery process (see 使用 Celery 的后台任务) usually produces its own logs as well.
The example system-wide setups logs to several files under /var/log/celery/
.
Docker containers log to their output (as per usual in the Docker world), so
you can look at the logs using docker-compose logs
.
不处理后台任务
A lot of things are done in the background by Celery workers. If things like sending out e-mails or component removal does not work, there might a related issue.
在那种情况下需要检查的事情:
Check that the Celery process is running, see 使用 Celery 的后台任务
Check the Celery queue status, either in 管理界面, or using
celery_queues
Look in the Celery logs for errors (see Weblate 日志)
不接收来自 Weblate 的电子邮件
You can verify whether outgoing e-mail is working correctly by using the
sendtestemail
management command (see 调用管理命令
for instructions on how to invoke it in different environments) or by using
管理界面 under the Tools tab.
These send e-mails directly, so this verifies that your SMTP configuration is correct (see 配置电子邮件发件箱). Most of the e-mails from Weblate are however sent in the background and there might be some issues with Celery involved as well, please see 不处理后台任务 for debugging that.
分析应用的崩溃
In case the application crashes, it is useful to collect as much info about the crash as possible. This can be achieved by using third-party services which can collect such info automatically. You can find info on how to set this up in 收集错误报告.
无报告的故障
很多任务写在到 Celery 进行后台处理。故障不显示在用户界面上,但出现在 Celery 的日志中。配置 收集错误报告 会帮助您更容易地注意到这样的故障。
性能问题
In case Weblate performs badly in some scenario, please collect the relevant logs showing the issue, and anything that might help figuring out where the code might be improved.
如果有些请求在没有任何提示的情况下花费了很长时间,你可能想要安装 dogslow,附加参数 收集错误报告 并在错误收集工具中获取精确和详细的回溯信息。