Skip to content

Reduce CLI diagnostic log noise and improve process logging#15956

Merged
JamesNK merged 5 commits intomainfrom
jamesn/diskcache-reduce-log-level
Apr 9, 2026
Merged

Reduce CLI diagnostic log noise and improve process logging#15956
JamesNK merged 5 commits intomainfrom
jamesn/diskcache-reduce-log-level

Conversation

@JamesNK
Copy link
Copy Markdown
Member

@JamesNK JamesNK commented Apr 8, 2026

Description

Reduces diagnostic log noise in the Aspire CLI and improves process execution logging clarity.

Changes:

  • ProcessExecution/ProcessExecutionFactory: Instead of checking SuppressLogging at every log call site, the factory now passes NullLogger.Instance when logging is suppressed. This simplifies ProcessExecution by removing all conditional logging branches.
  • Process log messages improved: Include both file name and working directory for better diagnostics.
  • Features: Downgraded "using default value" log from Debug to Trace to reduce noise. Added LogFeatureState() method that logs all feature flag states at startup.
  • Program.cs: Calls LogFeatureState() at startup so feature configuration is visible in diagnostic logs.
  • NuGetPackageCache / BundleNuGetPackageCache: Hoisted IsFeatureEnabled call out of the per-package filter lambda to avoid redundant evaluations.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
    • No

Copilot AI review requested due to automatic review settings April 8, 2026 07:35
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

🚀 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/microsoft/aspire/main/eng/scripts/get-aspire-cli-pr.sh | bash -s -- 15956

Or

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

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

This PR reduces diagnostic log noise in the Aspire CLI while improving the clarity and consistency of process execution logging. It also adds a startup log of all known feature flag states and avoids redundant feature-flag evaluation in NuGet package filtering.

Changes:

  • Centralize “suppress logging” behavior in ProcessExecutionFactory by using NullLogger and simplify ProcessExecution logging branches.
  • Add IFeatures.LogFeatureState() and call it at CLI startup to emit feature flag state for diagnostics.
  • Reduce log verbosity for cache/feature default behavior and avoid repeated IsFeatureEnabled calls inside per-package filter lambdas.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/Aspire.Cli/Program.cs Calls LogFeatureState() during startup to surface feature configuration in logs.
src/Aspire.Cli/NuGet/NuGetPackageCache.cs Hoists ShowDeprecatedPackages evaluation outside the per-package filter lambda.
src/Aspire.Cli/NuGet/BundleNuGetPackageCache.cs Hoists ShowDeprecatedPackages evaluation outside the per-package filter lambda.
src/Aspire.Cli/DotNet/ProcessExecutionFactory.cs Uses NullLogger when suppressed and improves “running process” log context.
src/Aspire.Cli/DotNet/ProcessExecution.cs Removes per-callsite suppression checks; adjusts process start/wait and stream forwarding logging.
src/Aspire.Cli/Configuration/IFeatures.cs Adds new LogFeatureState() API to the internal feature service contract.
src/Aspire.Cli/Configuration/Features.cs Downgrades default-value log to Trace and implements LogFeatureState().
src/Aspire.Cli/Caching/DiskCache.cs Downgrades cache hit/miss/store/delete logs from Debug to Trace.

@JamesNK JamesNK force-pushed the jamesn/diskcache-reduce-log-level branch from 954444d to 2011c88 Compare April 9, 2026 01:35
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

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.
GitHub was asked to rerun all failed jobs for that attempt, and the rerun is being tracked in the rerun attempt.
The job links below point to the failed attempt jobs that matched the retry-safe transient failure rules.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

🎬 CLI E2E Test Recordings — 56 recordings uploaded (commit c4a5833)

View recordings
Test Recording
AddPackageInteractiveWhileAppHostRunningDetached ▶️ View Recording
AddPackageWhileAppHostRunningDetached ▶️ View Recording
AgentCommands_AllHelpOutputs_AreCorrect ▶️ View Recording
AgentInitCommand_DefaultSelection_InstallsSkillOnly ▶️ View Recording
AgentInitCommand_MigratesDeprecatedConfig ▶️ View Recording
AllPublishMethodsBuildDockerImages ▶️ View Recording
AspireAddPackageVersionToDirectoryPackagesProps ▶️ View Recording
AspireUpdateRemovesAppHostPackageVersionFromDirectoryPackagesProps ▶️ View Recording
Banner_DisplayedOnFirstRun ▶️ View Recording
Banner_DisplayedWithExplicitFlag ▶️ View Recording
Banner_NotDisplayedWithNoLogoFlag ▶️ View Recording
CertificatesClean_RemovesCertificates ▶️ View Recording
CertificatesTrust_WithNoCert_CreatesAndTrustsCertificate ▶️ View Recording
CertificatesTrust_WithUntrustedCert_TrustsCertificate ▶️ View Recording
ConfigSetGet_CreatesNestedJsonFormat ▶️ View Recording
CreateAndRunAspireStarterProject ▶️ View Recording
CreateAndRunAspireStarterProjectWithBundle ▶️ View Recording
CreateAndRunEmptyAppHostProject ▶️ View Recording
CreateAndRunJavaEmptyAppHostProject ▶️ View Recording
CreateAndRunJsReactProject ▶️ View Recording
CreateAndRunPythonReactProject ▶️ View Recording
CreateAndRunTypeScriptEmptyAppHostProject ▶️ View Recording
CreateAndRunTypeScriptStarterProject ▶️ View Recording
CreateJavaAppHostWithViteApp ▶️ View Recording
CreateStartAndStopAspireProject ▶️ View Recording
CreateTypeScriptAppHostWithViteApp ▶️ View Recording
DashboardRunWithOtelTracesReturnsNoTraces ▶️ View Recording
DescribeCommandResolvesReplicaNames ▶️ View Recording
DescribeCommandShowsRunningResources ▶️ View Recording
DetachFormatJsonProducesValidJson ▶️ View Recording
DoctorCommand_DetectsDeprecatedAgentConfig ▶️ View Recording
DoctorCommand_WithSslCertDir_ShowsTrusted ▶️ View Recording
DoctorCommand_WithoutSslCertDir_ShowsPartiallyTrusted ▶️ View Recording
GlobalMigration_HandlesCommentsAndTrailingCommas ▶️ View Recording
GlobalMigration_HandlesMalformedLegacyJson ▶️ View Recording
GlobalMigration_PreservesAllValueTypes ▶️ View Recording
GlobalMigration_SkipsWhenNewConfigExists ▶️ View Recording
GlobalSettings_MigratedFromLegacyFormat ▶️ View Recording
InvalidAppHostPathWithComments_IsHealedOnRun ▶️ View Recording
LegacySettingsMigration_AdjustsRelativeAppHostPath ▶️ View Recording
LogsCommandShowsResourceLogs ▶️ View Recording
PsCommandListsRunningAppHost ▶️ View Recording
PsFormatJsonOutputsOnlyJsonToStdout ▶️ View Recording
PublishWithDockerComposeServiceCallbackSucceeds ▶️ View Recording
RestoreGeneratesSdkFiles ▶️ View Recording
RestoreSupportsConfigOnlyHelperPackageAndCrossPackageTypes ▶️ View Recording
RunFromParentDirectory_UsesExistingConfigNearAppHost ▶️ View Recording
RunWithMissingAwaitShowsHelpfulError ▶️ View Recording
SecretCrudOnDotNetAppHost ▶️ View Recording
SecretCrudOnTypeScriptAppHost ▶️ View Recording
StagingChannel_ConfigureAndVerifySettings_ThenSwitchChannels ▶️ View Recording
StopAllAppHostsFromAppHostDirectory ▶️ View Recording
StopAllAppHostsFromUnrelatedDirectory ▶️ View Recording
StopNonInteractiveMultipleAppHostsShowsError ▶️ View Recording
StopNonInteractiveSingleAppHost ▶️ View Recording
StopWithNoRunningAppHostExitsSuccessfully ▶️ View Recording

📹 Recordings uploaded automatically from CI run #24168436170

@JamesNK JamesNK merged commit 93d7bfa into main Apr 9, 2026
783 of 789 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants