HttpClientTarget - HttpClient with support for batching#20
HttpClientTarget - HttpClient with support for batching#20snakefoot wants to merge 19 commits intoNLog:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new HttpClientTarget to NLog.Targets.Network (for non-NET35 TFMs) and introduces an accompanying test suite that validates HTTP method selection, batching behavior, headers, gzip compression, payload splitting, and retry behavior.
Changes:
- Added
HttpClientTargetimplementation with batching, optional gzip compression, custom headers, proxy support, and retry handling. - Added
HttpClientTargetTestswith a lightweight in-process TCP HTTP server to validate outgoing requests. - Updated
NLog.Targets.Network.csprojtarget frameworks (addsnet471) and framework references to supportHttpClient.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| tests/NLog.Targets.Network.Tests/HttpClientTargetTests.cs | New tests validating HTTP request behavior for the new target. |
| src/NLog.Targets.Network/Targets/HttpClientTarget.cs | New HttpClientTarget implementation (batching, compression, headers, proxy, retry). |
| src/NLog.Targets.Network/NLog.Targets.Network.csproj | Adds net471 target and System.Net.Http reference for .NET Framework builds (non-net35). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
74664c2 to
7d92a44
Compare
There was a problem hiding this comment.
Pull request overview
Introduces a new HttpClientTarget to the NLog.Targets.Network package for sending log events over HTTP(S), along with a new test suite and updated multi-targeting/package settings to support additional .NET Framework versions.
Changes:
- Add
HttpClientTargetimplementation (HTTP method selection, headers, proxy, retries, batching, compression, max payload splitting). - Add
HttpClientTargetTestsusing a minimal in-process TCP HTTP server to validate behavior. - Expand target frameworks to include
net471and update test SDK package version.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| tests/NLog.Targets.Network.Tests/NLog.Targets.Network.Tests.csproj | Adds net471 to test TFMs and updates Microsoft.NET.Test.Sdk. |
| tests/NLog.Targets.Network.Tests/HttpClientTargetTests.cs | New tests covering basic send, headers, batching, gzip, and retry behavior. |
| src/NLog.Targets.Network/Targets/HttpClientTarget.cs | New HttpClient-based target implementation. |
| src/NLog.Targets.Network/NLog.Targets.Network.csproj | Adds net471 and conditional framework references required for HttpClient. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
a465b1a to
fe7aafa
Compare
1df42b4 to
86dd1c4
Compare
f12ec9f to
329511a
Compare
662ff23 to
edcd065
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…cNow for lifetime
I guess for OpenTelemetry with GRPC-protocol, then this must be opened up a little more to serialize with protobuf.
But right now it support Json / Xml that is encoded as UTF8 along with optional GZip compression.