Add configurable HTTP logging to prevent verbose output from GitHub operations
GitHub API operations (especially file uploads) were logging full request/response bodies including binary streams, generating >15,000 lines of output per operation.
Changes
Configuration
- Added
PipelineOptions.DefaultHttpLogging(default:StatusCode | Duration) - Added
GitHubOptions.HttpLoggingfor per-integration override - Reused existing
HttpLoggingTypeflags:None,Request,Response,StatusCode,Duration
Implementation
- Modified
GitHub.csto conditionally add HTTP handlers based on configured logging level - Handler chain now built dynamically instead of always including all handlers
Testing & Documentation
- Added unit tests for configuration scenarios
- Updated GitHub package docs with usage examples
Usage
// Default: only status codes and duration (no request/response bodies)
await PipelineHostBuilder.Create()
.ExecutePipelineAsync();
// Disable HTTP logging entirely
await PipelineHostBuilder.Create()
.ConfigureServices((_, services) =>
{
services.Configure<GitHubOptions>(opt =>
opt.HttpLogging = HttpLoggingType.None);
})
.ExecutePipelineAsync();
// Enable verbose logging when debugging
services.Configure<GitHubOptions>(opt =>
opt.HttpLogging = HttpLoggingType.Request | HttpLoggingType.Response);
Impact
- Default behavior prevents log spam while retaining useful debugging info
- Pattern consistent with existing
CommandLoggingconfiguration - No breaking changes
Original prompt
This section details on the original issue you should resolve
<issue_title>IHttpLogger spams messages</issue_title> <issue_description>The
ModularPipelines.GitHub.GitHubclass hasIHttpLogger, but it is overly aggressive. For example, for a call toreturn await targetFiles .SelectAsync(async file => { var asset = new ReleaseAssetUpload { ContentType = "application/x-binary", FileName = file.Name, RawData = file.GetStream() }; return await context.GitHub().Client.Repository.Release.UploadAsset(release, asset, cancellationToken); }, cancellationToken) .ProcessOneAtATime();I get >15,000 lines in the output. The current implementation even logs the stream of the uploaded file.
![]()
![]()
Ideally nice to have something like CommandLogging in Commands, to control it</issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes thomhurst/ModularPipelines#1318
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.