code-oss-logs

作者: microsoft

從 Code OSS 開發版本中尋找並讀取日誌。使用時機:尋找日誌、讀取日誌檔案、除錯 Code OSS、檢查渲染器日誌、擴充套件主機日誌、代理程式…

npx skills add https://github.com/microsoft/vscode --skill code-oss-logs

Code OSS Logs

Find and display logs from the most recent Code OSS or Agents app dev run.

Log Root Directories

AppDefault User Data DirLogs Path
Code OSS$HOME/.vscode-oss-dev$HOME/.vscode-oss-dev/logs/
Agents app$HOME/.vscode-oss-dev$HOME/.vscode-oss-dev/logs/

If Code OSS was launched with --user-data-dir=<dir>, use <dir>/logs/ instead of the defaults above. Launch and debugging helpers often create temporary user data dirs under .build/; always prefer the exact user data dir from the launch command when it is known.

Each run creates a timestamped folder like 20260330T163430. The most recent folder sorted by modification time is usually the one the user cares about.

Procedure

  1. Identify which app the user is asking about: Code OSS or Agents app. If unclear, check both.
  2. Find the most recent log folder:
    ls -lt "$HOME/.vscode-oss-dev/logs" | head -5
    # or for a custom user data dir:
    ls -lt "<user-data-dir>/logs" | head -5
    
  3. Navigate into the most recent folder and list contents.
  4. Read the relevant log file(s) based on what the user is investigating. Use tail for recent entries or rg to filter.

Directory Layout

Each timestamped log folder has this structure:

<timestamp>/
├── main.log                    # Electron main process (app lifecycle, window management)
├── agenthost.log               # Agent host process (Copilot agent, model listing, agent sessions)
├── mcpGateway.log              # MCP gateway/server coordination
├── sharedprocess.log           # Shared process (extensions gallery, global services)
├── telemetry.log               # Telemetry events
├── terminal.log                # Terminal/pty activity
├── ptyhost.log                 # Pty host process
├── network-shared.log          # Shared network activity
├── editSessions.log            # Edit sessions / cloud changes
├── userDataSync.log            # Settings sync
├── remoteTunnelService.log     # Remote tunnel service
│
└── window1/                    # Per-window logs (window1, window2, etc.)
    ├── renderer.log            # Renderer process (workbench UI, services, startup)
    ├── network.log             # Per-window network activity
    ├── views.log               # View/panel activity
    ├── notebook.rendering.log  # Notebook rendering
    ├── customizationsDebug.log # Agent customizations debug info (Agents app)
    ├── mcpServer.*.log         # Per-MCP-server logs (one file per configured server)
    │
    ├── exthost/                # Extension host logs
    │   ├── exthost.log         # Extension host main log (activation, errors)
    │   ├── extHostTelemetry.log
    │   ├── <publisher.extension>/  # Per-extension log folders
    │   │   └── <extension>.log
    │   └── output_logging_<timestamp>/  # Extension output channels
    │
    └── output_<timestamp>/     # Output channel logs (workbench side)
        ├── tasks.log           # Tasks output
        ├── agentSessionsOutput.log  # Agent sessions output (Agents app)
        └── agenthost.<clientId>.log  # Agent host IPC traffic when tracing is enabled

Multiple output_ Folders

A new output_<timestamp>/ folder and a corresponding output_logging_<timestamp>/ inside exthost/ is created each time the window reloads within the same session. The session-level timestamped folder, such as 20260330T163430/, stays the same, but each reload gets fresh output channel directories. The most recent output_* folder by timestamp has the logs for the current or latest reload. Earlier folders contain logs from prior reloads in that session.

Key Files by Use Case

Investigating...Check these files
App startup / crashesmain.log, window1/renderer.log
Extension issueswindow1/exthost/exthost.log, window1/exthost/<publisher.ext>/
Copilot / agent issuesagenthost.log, window1/exthost/GitHub.copilot-chat/
Agent host IPC (Agents app)window1/output_<timestamp>/agenthost.*.log
MCP server problemsmcpGateway.log, window1/mcpServer.*.log
Terminal problemsterminal.log, ptyhost.log
Network / auth issuesnetwork-shared.log, window1/network.log
Settings syncuserDataSync.log
Agent customizationswindow1/customizationsDebug.log (Agents app)

Useful Commands

# Recent entries from a log file
tail -50 "<timestamp>/window1/renderer.log"

# Search all logs in a run for a probe marker or error
rg -n "MY_PROBE|error" "<timestamp>"

# Show non-empty logs in a run
find "<timestamp>" -type f -size +0 -print

Temporary Console Forwarding Workflow

When using temporary console.log probes and you need those probes to persist in the normal log files, enable dev console forwarding locally before launching Code OSS.

  1. In src/vs/platform/log/common/log.ts, find isDevConsoleLogForwardingEnabled.
  2. Temporarily enable the commented Boolean("true") line:
    export const isDevConsoleLogForwardingEnabled = false
        || Boolean("true") // done "weirdly" so that a lint warning prevents you from pushing this
        ;
    
  3. Build or let the watch task pick up the change.
  4. Launch Code OSS or the Agents app and reproduce the issue.
  5. Read the relevant logs.
  6. Before finishing, restore the flag to its default-off state and remove every temporary console.log probe.

The Boolean("true") form is intentionally lint-hostile so an accidentally enabled flag should be caught before check-in. Do not check in this flag enabled.

Tips

  • For temporary dev probes in source builds, either console.log or ILogService is fine. Use whichever is easiest in the code you are touching.
  • console.log probes must never be checked in. If logging code is intended to stay in the product, use ILogService instead.
  • If dev console forwarding is enabled in the source build, console.debug, console.error, console.info, console.log, and console.warn are written through the process log service into the normal log files.
  • Console probes land in the log for the process that emitted them: main process in main.log, renderer/workbench in window1/renderer.log, shared process in sharedprocess.log, pty host in ptyhost.log, and agent host in agenthost.log. Extension host console output is observed from the renderer side and appears in window1/renderer.log when forwarding all extension-host console output is enabled.
  • If console forwarding is not enabled, use ILogService for probes that must persist in the log files; native console.log may only appear in DevTools or stdout.
  • Not all log files have content. Many are created empty and only populated if that subsystem produces output.
  • window1/ is the first window; multi-window sessions will have window2/, etc.
  • Log lines follow the format: YYYY-MM-DD HH:MM:SS.mmm [level] message.

來自 microsoft 的更多技能

oss-growth
microsoft
開源增長駭客角色
agent-framework-azure-ai-py
microsoft
使用Microsoft Agent Framework Python SDK(agent-framework-azure-ai)构建Azure AI Foundry代理。适用于使用AzureAIAgentsProvider创建持久化代理、使用托管工具(代码解释器、文件搜索、网络搜索)、集成MCP服务器、管理对话线程或实现流式响应。涵盖函数工具、结构化输出和多工具代理。
development
airunway-aks-setup
microsoft
在AKS上設定AI Runway——從裸叢集到執行模型。涵蓋叢集驗證、控制器安裝、GPU評估、供應商設定及首次部署。時機:「設定AI Runway」、「上線AKS叢集」、「安裝AI Runway」、「airunway設定」、「部署模型至AKS」、「在AKS上進行GPU推論」、「在AKS上設定KAITO」、「在AKS上執行LLM」、「在AKS上使用vLLM」、「在AKS上設定模型服務」、「AI Runway控制器」。
devops
appinsights-instrumentation
microsoft
使用Azure Application Insights檢測Web應用程式的指南。提供遙測模式、SDK設定與組態參考。適用時機:如何檢測應用程式、App Insights SDK、遙測模式、什麼是App Insights、Application Insights指南、檢測範例、APM最佳實踐。
devops
applicationinsights-web-ts
microsoft
使用Application Insights JavaScript SDK(@microsoft/applicationinsights-web)為瀏覽器/Web應用程式進行檢測。適用於真實使用者監控(RUM)——頁面檢視、點擊、AJAX/fetch依賴、例外、自訂事件,以及與後端OpenTelemetry追蹤關聯的瀏覽器端GenAI代理追蹤。涵蓋SDK載入器指令碼與npm設定、框架擴充(React、React Native、Angular)、點擊分析、遙測初始化器,以及從瀏覽器發出的代理/工具/模型span的OTel GenAI語意慣例。
devops
azure-ai-anomalydetector-java
microsoft
使用適用於 Java 的 Azure AI 異常偵測器 SDK 建置異常偵測應用程式。在實作單變量/多變量異常偵測、時間序列分析或 AI 驅動監控時使用。
development
azure-ai-language-conversations-py
microsoft
使用 azure-ai-language-conversations Python SDK 實作對話語言理解(CLU)。當使用 ConversationAnalysisClient 分析對話意圖與實體、建置 NLP 功能,或將語言理解整合至應用程式時使用。
development
azure-ai-ml-py
microsoft
Azure Machine Learning SDK v2 for Python。用於機器學習工作區、作業、模型、資料集、計算資源與管線。 觸發詞:「azure-ai-ml」、「MLClient」、「workspace」、「model registry」、「training jobs」、「datasets」。
development