1
0
mirror of synced 2025-12-21 19:06:49 -05:00
Files
docs/content/codespaces/troubleshooting/codespaces-logs.md
2022-04-21 11:15:33 +02:00

5.2 KiB

title, intro, product, versions, type, topics, shortTitle
title intro product versions type topics shortTitle
Codespaces logs Overview of the logging locations used by {% data variables.product.prodname_codespaces %}. {% data reusables.gated-features.codespaces %}
fpt ghec
* *
reference
Codespaces
Logging
Codespaces logs

Information on {% data variables.product.prodname_codespaces %} is output to three different logs:

  • Codespace logs
  • Creation logs
  • Extension logs ({% data variables.product.prodname_vscode %} desktop) or Browser console logs ({% data variables.product.prodname_vscode %} in the web)

Codespace logs

These logs contain detailed information about the codespace, the container, the session, and the {% data variables.product.prodname_vscode %} environment. They are useful for diagnosing connection issues and other unexpected behavior. For example, the codespace freezes but the "Reload Windows" option unfreezes it for a few minutes, or you are randomly disconnected from the codespace but able to reconnect immediately.

{% webui %}

  1. If you are using {% data variables.product.prodname_codespaces %} in the browser, ensure that you are connected to the codespace you want to debug.
  2. Open the {% data variables.product.prodname_vscode %} Command Palette (Shift + Command + P (Mac) / Ctrl + Shift + P (Windows)) and type Export logs. Select Codespaces: Export Logs from the list to download the logs.
  3. Define where to save the zip archive of logs then click Save (desktop) or click OK (web).
  4. If you are using {% data variables.product.prodname_codespaces %} in the browser, right-click on the zip archive of logs from the Explorer view and select Download… to download them to your local machine.

{% endwebui %}

{% vscode %}

  1. Open the {% data variables.product.prodname_vscode %} Command Palette (Shift + Command + P (Mac) / Ctrl + Shift + P (Windows)) and type Export logs. Select Codespaces: Export Logs from the list to download the logs.
  2. Define where to save the zip archive of logs then click Save (desktop) or click OK (web).

{% endvscode %}

{% cli %}

Currently you can't use {% data variables.product.prodname_cli %} to access these logs. To access them, open your codespace in {% data variables.product.prodname_vscode %} or in a browser.

{% endcli %}

Creation logs

These logs contain information about the container, dev container, and their configuration. They are useful for debugging configuration and setup problems.

{% webui %}

  1. Connect to the codespace you want to debug.
  2. Open the {% data variables.product.prodname_vscode_command_palette %} (Shift + Command + P (Mac) / Ctrl + Shift + P (Windows)) and type Creation logs. Select Codespaces: View Creation Log from the list to open the creation.log file.

If you want to share the log with support, you can copy the text from the creation log into a text editor and save the file locally.

{% endwebui %}

{% vscode %}

Open the Command Palette (Shift + Command + P (Mac) / Ctrl + Shift + P (Windows)) and type Creation logs. Select Codespaces: View Creation Log from the list to open the creation.log file.

If you want to share the log with support, you can copy the text from the creation log into a text editor and save the file locally.

{% endvscode %}

{% cli %}

{% data reusables.cli.cli-learn-more %}

To see the creation log use the gh codespace logs subcommand. After entering the command choose from the list of codespaces that's displayed.

gh codespace logs

For more information about this command, see the {% data variables.product.prodname_cli %} manual.

If you want to share the log with support, you can save the output to a file:

gh codespace logs -c <CODESPACE-NAME> > /path/to/logs.txt

{% endcli %}

Extension logs

These logs are available for {% data variables.product.prodname_vscode %} desktop users only. They are useful if it seems like the {% data variables.product.prodname_codespaces %} extension or {% data variables.product.prodname_vscode %} editor are having issues that prevent creation or connection.

  1. In {% data variables.product.prodname_vscode %}, open the Command Palette.
  2. Type Logs and select Developer: Open Extension Logs Folder from the list to open the extension log folder in your system's file explorer.

From this view, you can access logs generated by the various extensions that you use in {% data variables.product.prodname_vscode %}. You will see logs for GitHub Codespaces, GitHub Authentication, and Git, in addition to any other extensions you have enabled.

Browser console logs

These logs are useful only if you want to debug problems with using {% data variables.product.prodname_codespaces %} in the browser. They are useful for debugging problems creating and connecting to {% data variables.product.prodname_codespaces %}.

  1. In the browser window for the codespace you want to debug, open the developer tools window.
  2. Display the "Console" tab and click errors in the left side bar to show only the errors.
  3. In the log area on the right, right-click and select Save as to save a copy of the errors to your local machine. Save errors