{"meta":{"title":"GitHub Codespaces logs","intro":"Overview of the logs used by GitHub Codespaces.","product":"Codespaces","breadcrumbs":[{"href":"/en/codespaces","title":"Codespaces"},{"href":"/en/codespaces/troubleshooting","title":"Troubleshooting"},{"href":"/en/codespaces/troubleshooting/github-codespaces-logs","title":"Codespaces logs"}],"documentType":"article"},"body":"# GitHub Codespaces logs\n\nOverview of the logs used by GitHub Codespaces.\n\nInformation on GitHub Codespaces is output to various logs:\n\n<div class=\"ghd-tool webui\">\n\n* Codespace logs\n* Creation logs\n* Browser console logs (for the VS Code web client)\n\nExtension logs are available if you are using GitHub Codespaces in VS Code. Click the \"Visual Studio Code\" tab above for details.\n\n</div>\n\n<div class=\"ghd-tool vscode\">\n\n* Codespace logs\n* Creation logs\n* Extension logs (for the VS Code desktop application)\n\nBrowser logs are available if you are using GitHub Codespaces in your browser. Click the \"Web browser\" tab above for details.\n\n</div>\n\n<div class=\"ghd-tool cli\">\n\n* Codespace logs\n* Creation logs\n\nOther logs are available if you are using GitHub Codespaces in VS Code or in your web browser. Click the tabs above for details.\n\n</div>\n\n<div class=\"ghd-tool webui\">\n\n## Codespace logs\n\nThese logs contain detailed information about the codespace, the container, the session, and the VS Code 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.\n\n1. If you are using GitHub Codespaces in the browser, ensure that you are connected to the codespace you want to debug.\n2. Open the VS Code Command Palette (<kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux)) and type `export logs`. Select **Codespaces: Export Logs** from the list to download the logs.\n3. Define where to save the zip archive of logs then click **Save** (desktop) or click **OK** (web).\n4. If you are using GitHub 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.\n\n</div>\n\n<div class=\"ghd-tool vscode\">\n\n## Codespace logs\n\nThese logs contain detailed information about the codespace, the container, the session, and the VS Code 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.\n\n1. Open the VS Code Command Palette (<kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux)) and type `export log`. Select **Codespaces: Export Logs** from the list to download the logs.\n2. Define where to save the zip archive of logs then click **Save** (desktop) or click **OK** (web).\n\n</div>\n\n<div class=\"ghd-tool cli\">\n\n## Codespace logs\n\nThese logs contain detailed information about the codespace, the container, the session, and the VS Code 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.\n\nCurrently you can't use GitHub CLI to access these logs. To access them, open your codespace in VS Code or in a browser.\n\n</div>\n\n## Creation logs\n\nThese logs contain information about the container, dev container, and their configuration. They are useful for debugging configuration and setup problems.\n\n<div class=\"ghd-tool webui\">\n\n1. Connect to the codespace you want to debug.\n2. Open the VS Code Command Palette (<kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux)) and type `creation log`. Select **Codespaces: View Creation Log** from the list to open the `creation.log` file.\n\nIf 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.\n\n</div>\n\n<div class=\"ghd-tool vscode\">\n\nOpen the VS Code Command Palette (<kbd>Shift</kbd>+<kbd>Command</kbd>+<kbd>P</kbd> (Mac) / <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>P</kbd> (Windows/Linux)) and type `creation log`. Select **Codespaces: View Creation Log** from the list to open the `creation.log` file.\n\nIf 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.\n\n</div>\n\n<div class=\"ghd-tool cli\">\n\n> \\[!NOTE]\n> To learn more about GitHub CLI, see [About GitHub CLI](/en/github-cli/github-cli/about-github-cli).\n\nTo see the creation log use the `gh codespace logs` subcommand. After entering the command choose from the list of codespaces that's displayed.\n\n```shell\ngh codespace logs\n```\n\nFor more information about this command, see [the GitHub CLI manual](https://cli.github.com/manual/gh_codespace_logs).\n\nIf you want to share the log with support, you can save the output to a file:\n\n```shell\ngh codespace logs -c <CODESPACE-NAME> > /path/to/logs.txt\n```\n\n</div>\n\n<div class=\"ghd-tool vscode\">\n\n## Extension logs\n\nThese logs are available for VS Code desktop users only. They are useful if it seems like the GitHub Codespaces extension or VS Code editor are having issues that prevent creation or connection.\n\n1. In VS Code, open the Command Palette.\n2. Type `logs` and select **Developer: Open Extension Logs Folder**.\n3. Your system's file explorer is displayed showing various log files and folders. Open the folder `output_logging_DATETIME`.\n\nFrom this view, you can access logs generated by extensions you use in VS Code, including GitHub Codespaces.\n\n</div>\n\n<div class=\"ghd-tool webui\">\n\n## Browser console logs\n\nThese logs are useful only if you want to debug problems with using GitHub Codespaces in the browser. They are useful for debugging problems creating and connecting to GitHub Codespaces.\n\nThe following instructions are for Chrome. The steps for other browsers are similar.\n\n1. In the browser window for the codespace you want to debug, open the developer tools window.\n2. Click the **Console** tab.\n3. Show the console sidebar, if it is not already displayed. For more information, see [Console features reference](https://developer.chrome.com/docs/devtools/console/reference#sidebar) in the Chrome for Developers documentation.\n4. In the sidebar, click **NUMBER errors** to show only the errors.\n5. In the log area on the right, right-click and select **Save as** to save a copy of the errors to your local machine.\n\n   ![Screenshot of the developer tools panel in the Chrome browser. The right-click menu is displayed, showing the option \"Save as.\"](/assets/images/help/codespaces/browser-console-log-save.png)\n\n</div>\n\n## Further reading\n\n* [Reviewing your organization's audit logs for GitHub Codespaces](/en/codespaces/managing-codespaces-for-your-organization/reviewing-your-organizations-audit-logs-for-github-codespaces)\n* [Reviewing your security logs for GitHub Codespaces](/en/codespaces/managing-your-codespaces/reviewing-your-security-logs-for-github-codespaces)"}