Skip to main content

Enabling debug logging

If the workflow logs do not provide enough detail to diagnose why a workflow, job, or step is not working as expected, you can enable additional debug logging.

These extra logs are enabled by setting secrets or variables in the repository containing the workflow, so the same permissions requirements will apply:

  • 若要在 GitHub 上为个人帐户存储库创建机密或变量,你必须是存储库所有者。 若要在 GitHub 上为组织存储库创建机密或变量,你必须拥有 admin 访问权限。 最后,若要通过 REST API 为个人帐户存储库或组织存储库创建机密或变量,你必须拥有协作者访问权限。
  • 要为个人帐户存储库中的环境创建密码或变量,你必须是存储库所有者。 要为组织存储库中的环境创建密码或变量,必须具有 admin 访问权限。 有关环境的详细信息,请参阅“管理部署环境”。
  • 组织所有者和拥有“管理组织操作变量”或“管理组织操作机密”权限的用户可以在组织级别创建机密或变量。

有关详细信息,请参阅“关于自定义组织角色”。

For more information on setting secrets and variables, see "在 GitHub Actions 中使用机密" and "变量."

Additionally, anyone who has access to run a workflow can enable runner diagnostic logging and step debug logging for a workflow re-run. For more information, see "重新运行工作流程和作业."

Enabling runner diagnostic logging

Runner diagnostic logging provides additional log files that contain information about how a runner is executing a job. Two extra log files are added to the log archive:

  • The runner process log, which includes information about coordinating and setting up runners to execute jobs.
  • The worker process log, which logs the execution of a job.
  1. To enable runner diagnostic logging, set the following secret or variable in the repository that contains the workflow: ACTIONS_RUNNER_DEBUG to true. If both the secret and variable are set, the value of the secret takes precedence over the variable.
  2. To download runner diagnostic logs, download the log archive of the workflow run. The runner diagnostic logs are contained in the runner-diagnostic-logs folder. For more information on downloading logs, see "Using workflow run logs."

Enabling step debug logging

Step debug logging increases the verbosity of a job's logs during and after a job's execution.

  1. To enable step debug logging, set the following secret or variable in the repository that contains the workflow: ACTIONS_STEP_DEBUG to true. If both the secret and variable are set, the value of the secret takes precedence over the variable.
  2. After setting the secret or variable, more debug events are shown in the step logs. For more information, see "Using workflow run logs."