除錯 Weblate¶
缺陷的症狀可以是應用崩潰或行為錯誤。歡迎您蒐集任何這樣的問題的資訊,並將其提交給 issue tracker。
除錯模式¶
打開除錯模式將在瀏覽器中顯示例外。這在 web 介面上除錯問題非常有用,但不適於生產環境,因為這會導致效能問題,並洩露私有資料。
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. You can get more
detailed logs by changing WEBLATE_LOGLEVEL.
Not processing background tasks¶
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_queuesLook 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 Invoking management commands
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 Not processing background tasks 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 Collecting error reports and monitoring performance.
無報告的故障¶
很多工作寫在到 Celery 進行背景處理。故障不顯示在使用者介面上,但出現在 Celery 的紀錄中。配置 Collecting error reports and monitoring performance 會幫助您更容易地註意到這樣的故障。
效能問題¶
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.
See Collecting error reports and monitoring performance for information on setting up Sentry which can provide useful insights on badly performing operations.
In case the slow performance is linked to the database, you can also enable
logging of all database queries using following configuration after enabling
DEBUG:
LOGGING["loggers"]["django.db.backends"] = {"handlers": ["console"], "level": "DEBUG"}