Conversation
- Change default CLI log file level from Information to Debug - Set Logging__LogLevel__Default=Debug on app host env for diagnostics - Log ATS Info diagnostics at Debug level instead of Warning - Add retryCount parameter to ConnectAsync for backchannel connection tracking - Reduce noisy stdout/stderr process logging to Trace to avoid duplication with OutputCollector - Filter DefaultHttpClientFactory and NativeCertificateToolRunner to Trace by default
|
🚀 Dogfood this PR with:
curl -fsSL https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15800Or
iex "& { $(irm https://raw.githubusercontent.com/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 15800" |
|
Debug logs were pretty unreadable. I reduced noise a lot with some extra filters and reducing some logging to trace level. Example logs: |
There was a problem hiding this comment.
Pull request overview
Updates Aspire CLI logging behavior to provide more diagnostic signal by default (especially in the CLI log file), while reducing duplication/noise in several high-volume areas.
Changes:
- Default CLI file logging to
Debug(with some noisy categories filtered higher) and plumbsCliLoggingOptionsthrough DI for downstream consumers. - Propagates a default
Logging__LogLevel__Defaultto the AppHost environment (defaulting toDebug, respecting--log-level). - Refines logging signal/noise across backchannel connection retries, ATS diagnostics severity mapping, and process stdout/stderr forwarding (many moved from
Debug→Trace).
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/Aspire.Cli.Tests/Utils/CliTestHelper.cs | Registers CliLoggingOptions in test DI to match production wiring. |
| tests/Aspire.Cli.Tests/TestServices/TestAppHostCliBackchannel.cs | Updates test backchannel to new ConnectAsync signature with retryCount. |
| tests/Aspire.Cli.Tests/Commands/PublishCommandPromptingIntegrationTests.cs | Updates in-test backchannel implementation for new ConnectAsync overloads. |
| src/Aspire.Hosting.RemoteHost/AtsContextFactory.cs | Logs ATS Info diagnostics at Debug instead of Warning. |
| src/Aspire.Hosting.RemoteHost/Ats/CapabilityDispatcher.cs | Logs ATS Info diagnostics at Debug instead of Warning. |
| src/Aspire.Cli/Projects/ProcessGuestLauncher.cs | Downgrades guest process stdout/stderr logging from Debug to Trace. |
| src/Aspire.Cli/Projects/PrebuiltAppHostServer.cs | Downgrades server process stdout/stderr logging from Debug to Trace. |
| src/Aspire.Cli/Projects/GuestAppHostProject.cs | Passes retryCount into backchannel connect attempts for improved logging. |
| src/Aspire.Cli/Projects/DotNetBasedAppHostServerProject.cs | Downgrades generated project XML + process output logging to Trace. |
| src/Aspire.Cli/Projects/DotNetAppHostProject.cs | Injects CliLoggingOptions and sets AppHost Logging__LogLevel__Default. |
| src/Aspire.Cli/Program.cs | Adjusts default file logger filtering + registers CliLoggingOptions in DI. |
| src/Aspire.Cli/DotNet/DotNetCliRunner.cs | Passes retryCount into backchannel connect attempts. |
| src/Aspire.Cli/DotNet/DotNetCliExecution.cs | Downgrades dotnet stdout/stderr forwarding logs to Trace. |
| src/Aspire.Cli/Configuration/Features.cs | Downgrades feature-flag check logs to Trace. |
| src/Aspire.Cli/Backchannel/AppHostCliBackchannel.cs | Adds retryCount to ConnectAsync and varies “connecting” log level by retry count. |
- Clarify connectionAttempts increment in DotNetCliRunner by extracting to local variable - Fix comment to accurately describe DefaultHttpClientFactory/NativeCertificateToolRunner filtering - Fix socket/stream leak in ConnectAsync when capability check or setup fails - Handle SocketException timeout in ReconnectInternalAsync to prevent unhandled propagation
|
Re-running the failed jobs in the CI workflow for this pull request because 1 job was identified as retry-safe transient failures in the CI run attempt.
|
|
🎬 CLI E2E Test Recordings — 55 recordings uploaded (commit View recordings
📹 Recordings uploaded automatically from CI run #23896127594 |
Description
Improves CLI debug logging defaults to make diagnostics more useful out of the box.
Changes:
--debug.Logging__LogLevel__Default=Debugon the app host environment so debug output is captured in the CLI log file. Respects--log-levelif specified.AtsContextFactoryandCapabilityDispatcher.retryCountparameter toConnectAsyncfor connection attempt visibility in logs. Connecting log level varies by retry count (Debug every 10th attempt, Trace otherwise).ProcessGuestLauncher,PrebuiltAppHostServer, andDotNetBasedAppHostServerProjectchanged to Trace to avoid duplicating output already captured byOutputCollectorat Info level.DefaultHttpClientFactoryandNativeCertificateToolRunnerfiltered to Trace by default to reduce noise.Checklist