Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 31, 2025

DCP errors now flow to resources and are displayed in resource context. AppHost should not duplicate these logs at their original severity levels (Error/Warning/Info), creating console noise.

Changes

Modified DcpHost.LogSocketOutputAsync to map all DCP log levels to Debug/Trace:

  • DCP Error/Warning/Info/Debug → AppHost Debug
  • DCP Trace → AppHost Trace
  • Unparseable logs → AppHost Debug (was Information)
// Map DCP log levels to Debug/Trace to reduce noise in AppHost output.
// DCP errors are now flowing to resources and can be hidden from output,
// so we log them at Debug/Trace level instead of using the original DCP log level.
var appHostLogLevel = logLevel == LogLevel.Trace ? LogLevel.Trace : LogLevel.Debug;

Added test TryParseDcpLog_ParsesAllLogLevels to validate parser handles all DCP log levels.

Impact

DCP diagnostics are hidden from AppHost console by default. Users can enable Debug/Trace logging if needed. Resource-specific DCP errors remain visible in resource context.

Original prompt

We're flowing DCP errors to resources and now we can hide them from the output.

private async Task LogSocketOutputAsync(Socket socket, CancellationToken cancellationToken)

We should make these debug/trace level by default in the apphost ignoring the log level from dcp.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Update DCP errors to debug level output Log DCP messages at Debug/Trace level in AppHost Oct 31, 2025
Copilot AI requested a review from davidfowl October 31, 2025 01:34
@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

🚀 Dogfood this PR with:

⚠️ WARNING: Do not do this without first carefully reviewing the code of this PR to satisfy yourself it is safe.

curl -fsSL https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 12533

Or

  • Run remotely in PowerShell:
iex "& { $(irm https://raw.githubusercontent.com/dotnet/aspire/main/eng/scripts/get-aspire-cli-pr.ps1) } 12533"

@davidfowl davidfowl marked this pull request as ready for review October 31, 2025 07:58
Copilot AI review requested due to automatic review settings October 31, 2025 07:58
Copy link
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

This PR reduces the verbosity of DCP (Distributed Container Platform) logs in the AppHost output by downgrading all DCP log levels to Debug or Trace. The change acknowledges that DCP errors now flow to resources and can be filtered out, so they no longer need to be logged at their original severity levels in the AppHost output.

  • Changes DCP log level mapping to always use Debug (or Trace for Trace-level logs) instead of the original log level
  • Updates fallback logging for unparseable DCP logs from Information to Debug
  • Adds comprehensive test coverage using Theory pattern to verify all log levels are correctly parsed

Reviewed Changes

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

File Description
src/Aspire.Hosting/Dcp/DcpHost.cs Maps all DCP log levels to Debug/Trace to reduce noise, adds explanatory comment about the change
tests/Aspire.Hosting.Tests/Dcp/DcpLogParserTests.cs Adds parameterized test to verify parser handles all log levels correctly

@davidfowl davidfowl merged commit 7fa245f into main Nov 1, 2025
296 checks passed
@davidfowl davidfowl deleted the copilot/hide-dcp-errors-output branch November 1, 2025 06:56
@dotnet-policy-service dotnet-policy-service bot added this to the 13.1 milestone Nov 1, 2025
@davidfowl
Copy link
Member

/backport to release/13.0

@github-actions
Copy link
Contributor

github-actions bot commented Nov 1, 2025

Started backporting to release/13.0: https://github.com/dotnet/aspire/actions/runs/18993029761

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants