Viewing logs

Use the Log Viewer in Code when you need to view, filter, or download log output from your dev containers or from Code itself. You can diagnose launch failures, unexpected container behavior, or errors that you want to share with a support team.

Before you begin

You must have completed the following tasks:
  • You have opened the Code landing page.
  • You are a member of at least one teamspace, if you want to view the container-level logs.

About this task

Log Viewer opens as a panel within the Code interface. You access it from the help menu in the top-right corner of the page. Once open, you can switch between Code logs and dev container logs using the Source dropdown, apply severity filters, search log entries by keyword, and download captured logs as a file. The Log Viewer captures trace logs from your running dev containers and from Code itself. It does not capture output from applications that run inside the dev containers, for example, the output of a Node.js application.

Procedure

  1. Open the Log Viewer:
    1. Onthe Code landing page, click the help icon (top-right).

    2. In the dropdown menu, click Logs. The Log Viewer panel opens.
  2. Select a log source:
    1. In the upper-right area of the Log Viewer panel, click the Source dropdown.

    2. To view logs for a container or containers grouped by their teamspace, select the teamspace name from the Source dropdown, then select an individual container if needed.

      App Logs show internal logs of Code, not logs from apps inside the dev containers.

  3. Filter the log output:
    1. In the search bar at the top of the panel where there is the Search logs... placeholder, type a keyword to narrow entries by matching text.
    2. Click one or more filter buttons to show only entries of that severity level. The following filters are available:
      Button Description
      ALL Displays all log entries regardless of level.
      LOG Shows log entries without severity levels by using a generic format to record plain-text, non-critical data for simple auditing.
      INFO Shows informational messages about normal operational activity.
      WARN Shows warning-level entries, indicating conditions that might lead to errors.
      ERROR Shows error-level log entries, indicating failures that require attention.
      Note:
      You can enable multiple filters simultaneously. For example, selecting both WARN and ERROR shows only warning and error entries together.
    3. To load the latest entries, click the Refresh icon in the top-right area of the panel.
  4. View log entry details:
    1. Locate the log entry you want to inspect. Each row shows a timestamp, a color-coded level badge (for example, INFO or ERROR), and a short message.
    2. Click the expand arrow on the right side of the row. When expanded, the entry displays sections such as Details, which indicates that the entry is expanded and contains further information, and Context, which provides the namespace and pod name associated with the error.
    3. Click the collapse arrow to close the expanded view and return to the compact list.
  5. Adjust the number of displayed entries:
    1. At the bottom of the panel, click the count selector on the left (default is 10) and select a different value to change how many entries are shown per page.
    2. Use the arrow controls to move between pages.
  6. Download the logs:
    1. Click the Download icon in the top-right area of the Log Viewer panel.
    2. Save the exported file to your local system.
      Note:
      The download exports only the entries that are currently visible based on your active source and filter selections. Adjust your filters before downloading if you need a specific subset of entries.

Results

You have opened the Log Viewer, selected a log source, applied filters, and reviewed or downloaded log entries from your Code environment. You can now use the log output to identify the cause of issues in your dev containers or share the file with a support team.

What to do next

After you review the log output, consider the following next steps:
  • If you identified an error in the logs, see Configuring dev containers to adjust the settings that may be causing the issue.
  • If the issue persists, share the downloaded log file with your administrator for further investigation.