調試 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.

也參考

配置的例子 包含 LOGGING 配置。

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.

Things to check in that case:

不接收來自 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 Configuring outgoing e-mail). 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.

無報告的故障

很多任務寫在到 Celery 進行後台處理。故障不顯示在用戶界面上,但出現在 Celery 的日誌中。配置 Collecting error reports 會幫助您更容易地註意到這樣的故障。

性能問題

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 <https://pypi.org/project/dogslow/>`_,附加參數:ref:`collecting-errors`並在錯誤收集工具中獲取精確和詳細的回溯信息。

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"}