Skip to content

Enable verbose logging when System.Debug is set in Azure Pipelines#4027

Merged
heaths merged 4 commits intomainfrom
copilot/add-debug-tracing-environment-vars
Mar 25, 2026
Merged

Enable verbose logging when System.Debug is set in Azure Pipelines#4027
heaths merged 4 commits intomainfrom
copilot/add-debug-tracing-environment-vars

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 25, 2026

When System.Debug is enabled in Azure DevOps, enable verbose logging for both Rust tests and the test-proxy process to improve failure diagnostics.

  • eng/pipelines/templates/variables/rust.yml: Set RUST_LOG=trace when System.Debug is true, RUST_LOG=info otherwise (single source of truth for Rust log level).
  • eng/pipelines/templates/jobs/ci.tests.yml and live.tests.yml: Add a conditional step to set Logging__LogLevel__Default=Debug (ASP.NET Core log level for test-proxy) when System.Debug is true.
  • eng/pipelines/templates/jobs/ci.tests.yml: Add a conditional step to dump test-proxy audit logs via Invoke-WebRequest when System.Debug is true, with error handling so failures don't mask test results.
Original prompt

This section details on the original issue you should resolve

<issue_title>Enable tracing and more information when System.Debug is checked in AzDO</issue_title>
<issue_description>When we check System.Debug (env var SYSTEM_DEBUG, I believe) in Azure DevOps, we should set env vars like in #4025 and set RUST_LOG=trace to log more information for diagnostics so we can more easily troubleshoot issues like we saw for #4001.</issue_description>

<agent_instructions>Get changes to the pipeline in #4025 to determine what environment variables to set when System.Debug is checked in Azure Pipelines. There's an Azure Pipelines variable for that or I believe you can also use the SYSTEM_DEBUG environment variable, but you should figure that out. Open a PR that updates the appropriate pipeline under eng/pipelines to set the env vars before starting the test proxy or running tests.</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@heaths We could add a step to our local build scripts under `eng/pipelines` that would export environment variables `RUST_LOG` and whatever #4025 is setting to have ASP.NET's HTTP server log more information, which test-proxy supports.

Custom agent used: agentic-workflows
GitHub Agentic Workflows (gh-aw) - Create, debug, and upgrade AI-powered workflows with intelligent prompt routing


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

When System.Debug is true in Azure DevOps, set RUST_LOG=trace and
Logging__LogLevel__Default=Debug to enable verbose logging from both
the Rust test code and the ASP.NET Core test-proxy process. Also adds
the "Dump Test Proxy Audit Logs" step from PR #4025.

Fixes #4026

Co-authored-by: heaths <1532486+heaths@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-rust/sessions/a6b116bf-9dde-4eeb-a0ae-b45a876adc6a
Copilot AI changed the title [WIP] Enable tracing when System.Debug is checked in AzDO Enable verbose logging when System.Debug is set in Azure Pipelines Mar 25, 2026
Copilot AI requested a review from heaths March 25, 2026 01:23
@heaths heaths marked this pull request as ready for review March 25, 2026 18:42
Copilot AI review requested due to automatic review settings March 25, 2026 18:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Rust CI/live-test Azure Pipelines job templates so that enabling System.Debug turns on more verbose diagnostics for both Rust tests and the test-proxy process, improving failure triage.

Changes:

  • Add a conditional step (when System.Debug == true) to set RUST_LOG=trace and Logging__LogLevel__Default=Debug so subsequent steps inherit verbose logging.
  • In CI test jobs, add a conditional step to dump test-proxy audit logs (GET /Audit/Logs) when System.Debug == true.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
eng/pipelines/templates/jobs/live.tests.yml Adds conditional verbose logging variable setup for live test jobs.
eng/pipelines/templates/jobs/ci.tests.yml Adds conditional verbose logging variable setup and a conditional step to dump test-proxy audit logs.

@copilot also change variables/rust.yml so that we set "trace" instead of "debug" if System.Debug is true, and set the default level = currently just "" - to "info".

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Member

@heaths heaths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot I told you to also update eng/pipelines/templates/variables/rust.yml to set RUST_LOG to trace when System.Debug is true, or set it to info otherwise.

Instead of duplicating RUST_LOG in each job template, update the shared
variables template to use 'trace' when System.Debug is true and 'info'
otherwise (previously 'debug' / empty string).

Co-authored-by: heaths <1532486+heaths@users.noreply.github.com>
Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-rust/sessions/48fbd5b7-0e05-4d88-af2c-410dade8cf74
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 25, 2026

@copilot I told you to also update eng/pipelines/templates/variables/rust.yml to set RUST_LOG to trace when System.Debug is true, or set it to info otherwise.

Done in aa6e5b8. Updated eng/pipelines/templates/variables/rust.yml to set RUST_LOG=trace when System.Debug is true, and RUST_LOG=info otherwise. The job templates only set Logging__LogLevel__Default=Debug (for test-proxy's ASP.NET logging) so there's no duplication.

@heaths
Copy link
Copy Markdown
Member

heaths commented Mar 25, 2026

@copilot summarize the pull request description. Why do you keep leaving your task list in there? It's useless!

@heaths heaths enabled auto-merge (squash) March 25, 2026 20:46
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 25, 2026

@copilot summarize the pull request description. Why do you keep leaving your task list in there? It's useless!

Updated the PR description with a proper summary.

Copilot AI requested a review from heaths March 25, 2026 20:47
@heaths
Copy link
Copy Markdown
Member

heaths commented Mar 25, 2026

/check-enforcer evaluate

Copy link
Copy Markdown
Member

@scbedd scbedd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@heaths heaths merged commit d04bc61 into main Mar 25, 2026
21 checks passed
@heaths heaths deleted the copilot/add-debug-tracing-environment-vars branch March 25, 2026 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable tracing and more information when System.Debug is checked in AzDO

4 participants