96 references to HttpClientLoggingTagNames
Microsoft.Extensions.Http.Diagnostics (32)
Logging\Internal\Log.cs (30)
26
$"{{{
HttpClientLoggingTagNames
.Method}}} {{{
HttpClientLoggingTagNames
.Host}}}/{{{
HttpClientLoggingTagNames
.Path}}}";
30
$"{{{
HttpClientLoggingTagNames
.Method}}} {{{
HttpClientLoggingTagNames
.Host}}}/{{{
HttpClientLoggingTagNames
.Path}}}";
33
$"The logger couldn't read its context for {{RequestState}} request: {{{
HttpClientLoggingTagNames
.Method}}} {{{
HttpClientLoggingTagNames
.Host}}}";
37
$"{{{
HttpClientLoggingTagNames
.Method}}} {{{
HttpClientLoggingTagNames
.Host}}}/{{{
HttpClientLoggingTagNames
.Path}}}";
55
[TagName(
HttpClientLoggingTagNames
.Method)] HttpMethod method,
56
[TagName(
HttpClientLoggingTagNames
.Host)] string? host,
57
[TagName(
HttpClientLoggingTagNames
.Path)] string? path);
63
[TagName(
HttpClientLoggingTagNames
.Method)] HttpMethod method,
64
[TagName(
HttpClientLoggingTagNames
.Host)] string host,
65
[TagName(
HttpClientLoggingTagNames
.Path)] string path);
72
[TagName(
HttpClientLoggingTagNames
.Method)] HttpMethod method,
73
[TagName(
HttpClientLoggingTagNames
.Host)] string? host);
80
[TagName(
HttpClientLoggingTagNames
.Method)] HttpMethod method,
81
[TagName(
HttpClientLoggingTagNames
.Host)] string host,
82
[TagName(
HttpClientLoggingTagNames
.Path)] string path);
104
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.Method, record.Method);
105
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.Host, record.Host);
106
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.Path, record.Path);
107
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.Duration, record.Duration);
111
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.StatusCode, record.StatusCode.Value);
131
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.RequestBody, record.RequestBody);
136
loggerMessageState.TagArray[index] = new(
HttpClientLoggingTagNames
.ResponseBody, record.ResponseBody);
171
if (kvp.Key ==
HttpClientLoggingTagNames
.Method)
Logging\Internal\LoggerMessageStateExtensions.cs (2)
30
static x =>
HttpClientLoggingTagNames
.RequestHeaderPrefix + Normalize(x));
49
static x =>
HttpClientLoggingTagNames
.ResponseHeaderPrefix + Normalize(x));
Microsoft.Extensions.Http.Diagnostics.Tests (64)
Logging\AcceptanceTests.cs (7)
326
state!.Single(kvp => kvp.Key ==
HttpClientLoggingTagNames
.Path).Value.Should().Be(redactedPath);
369
.ContainSingle(kvp => kvp.Key ==
HttpClientLoggingTagNames
.Path)
372
state.Should().ContainSingle(kvp => kvp.Key ==
HttpClientLoggingTagNames
.Host)
375
state.Should().ContainSingle(kvp => kvp.Key ==
HttpClientLoggingTagNames
.Method)
378
state.Should().ContainSingle(kvp => kvp.Key ==
HttpClientLoggingTagNames
.StatusCode)
381
state.Should().ContainSingle(kvp => kvp.Key ==
HttpClientLoggingTagNames
.Duration)
438
state!.Single(kvp => kvp.Key ==
HttpClientLoggingTagNames
.Path).Value.Should().Be(redactedPath);
Logging\HttpClientLoggerTest.cs (53)
37
private const string TestExpectedRequestHeaderKey = $"{
HttpClientLoggingTagNames
.RequestHeaderPrefix}request-header";
38
private const string TestExpectedResponseHeaderKey = $"{
HttpClientLoggingTagNames
.ResponseHeaderPrefix}response-header";
167
var testSharedRequestHeaderKey = $"{
HttpClientLoggingTagNames
.RequestHeaderPrefix}header3";
168
var testSharedResponseHeaderKey = $"{
HttpClientLoggingTagNames
.ResponseHeaderPrefix}header3";
243
logRecordState.Contains(
HttpClientLoggingTagNames
.Host, expectedLogRecord.Host);
244
logRecordState.Contains(
HttpClientLoggingTagNames
.Method, expectedLogRecord.Method.ToString());
245
logRecordState.Contains(
HttpClientLoggingTagNames
.Path, TelemetryConstants.Redacted);
246
logRecordState.Contains(
HttpClientLoggingTagNames
.Duration, EnsureLogRecordDuration);
247
logRecordState.Contains(
HttpClientLoggingTagNames
.StatusCode, expectedLogRecord.StatusCode.Value.ToString(CultureInfo.InvariantCulture));
248
logRecordState.Contains(
HttpClientLoggingTagNames
.RequestBody, expectedLogRecord.RequestBody);
249
logRecordState.Contains(
HttpClientLoggingTagNames
.ResponseBody, expectedLogRecord.ResponseBody);
340
logRecordRequest.Contains(
HttpClientLoggingTagNames
.Host, expectedLogRecord.Host);
341
logRecordRequest.Contains(
HttpClientLoggingTagNames
.Method, expectedLogRecord.Method.ToString());
342
logRecordRequest.Contains(
HttpClientLoggingTagNames
.Path, TelemetryConstants.Redacted);
343
logRecordRequest.Contains(
HttpClientLoggingTagNames
.RequestBody, expectedLogRecord.RequestBody);
344
logRecordRequest.NotContains(
HttpClientLoggingTagNames
.StatusCode);
349
logRecordFull.Contains(
HttpClientLoggingTagNames
.Host, expectedLogRecord.Host);
350
logRecordFull.Contains(
HttpClientLoggingTagNames
.Method, expectedLogRecord.Method.ToString());
351
logRecordFull.Contains(
HttpClientLoggingTagNames
.Path, TelemetryConstants.Redacted);
352
logRecordFull.Contains(
HttpClientLoggingTagNames
.Duration, EnsureLogRecordDuration);
353
logRecordFull.Contains(
HttpClientLoggingTagNames
.StatusCode, expectedLogRecord.StatusCode.Value.ToString(CultureInfo.InvariantCulture));
354
logRecordFull.Contains(
HttpClientLoggingTagNames
.RequestBody, expectedLogRecord.RequestBody);
355
logRecordFull.Contains(
HttpClientLoggingTagNames
.ResponseBody, expectedLogRecord.ResponseBody);
445
logRecordState.Contains(
HttpClientLoggingTagNames
.Host, expectedLogRecord.Host);
446
logRecordState.Contains(
HttpClientLoggingTagNames
.Method, expectedLogRecord.Method.ToString());
447
logRecordState.Contains(
HttpClientLoggingTagNames
.Path, TelemetryConstants.Redacted);
448
logRecordState.Contains(
HttpClientLoggingTagNames
.RequestBody, expectedLogRecord.RequestBody);
449
logRecordState.NotContains(
HttpClientLoggingTagNames
.ResponseBody);
450
logRecordState.NotContains(
HttpClientLoggingTagNames
.StatusCode);
454
logRecordState.Contains(
HttpClientLoggingTagNames
.Duration, EnsureLogRecordDuration);
455
Assert.DoesNotContain(logRecordState, kvp => kvp.Key.StartsWith(
HttpClientLoggingTagNames
.ResponseHeaderPrefix));
560
logRecordState.Contains(
HttpClientLoggingTagNames
.Host, expectedLogRecord.Host);
561
logRecordState.Contains(
HttpClientLoggingTagNames
.Method, expectedLogRecord.Method.ToString());
562
logRecordState.Contains(
HttpClientLoggingTagNames
.Path, TelemetryConstants.Redacted);
563
logRecordState.Contains(
HttpClientLoggingTagNames
.RequestBody, expectedLogRecord.RequestBody);
564
logRecordState.NotContains(
HttpClientLoggingTagNames
.ResponseBody);
565
logRecordState.NotContains(
HttpClientLoggingTagNames
.StatusCode);
569
logRecordState.Contains(
HttpClientLoggingTagNames
.Duration, EnsureLogRecordDuration);
570
Assert.DoesNotContain(logRecordState, kvp => kvp.Key.StartsWith(
HttpClientLoggingTagNames
.ResponseHeaderPrefix));
650
logRecordState.Contains(
HttpClientLoggingTagNames
.Host, expectedLogRecord.Host);
651
logRecordState.Contains(
HttpClientLoggingTagNames
.Method, expectedLogRecord.Method.ToString());
652
logRecordState.Contains(
HttpClientLoggingTagNames
.Path, TelemetryConstants.Redacted);
653
logRecordState.Contains(
HttpClientLoggingTagNames
.Duration, EnsureLogRecordDuration);
654
logRecordState.Contains(
HttpClientLoggingTagNames
.StatusCode, expectedLogRecord.StatusCode.Value.ToString(CultureInfo.InvariantCulture));
655
logRecordState.Contains(
HttpClientLoggingTagNames
.RequestBody, expectedLogRecord.RequestBody);
656
logRecordState.Contains(
HttpClientLoggingTagNames
.ResponseBody, expectedLogRecord.ResponseBody);
923
logRecord.Contains(
HttpClientLoggingTagNames
.Host, expectedLogRecord.Host);
924
logRecord.Contains(
HttpClientLoggingTagNames
.Method, expectedLogRecord.Method.ToString());
925
logRecord.Contains(
HttpClientLoggingTagNames
.Path, TelemetryConstants.Redacted);
926
logRecord.Contains(
HttpClientLoggingTagNames
.Duration, EnsureLogRecordDuration);
927
logRecord.Contains(
HttpClientLoggingTagNames
.StatusCode, expectedLogRecord.StatusCode.Value.ToString(CultureInfo.InvariantCulture));
928
logRecord.Contains(
HttpClientLoggingTagNames
.RequestBody, expectedLogRecord.RequestBody);
929
logRecord.Contains(
HttpClientLoggingTagNames
.ResponseBody, expectedLogRecord.ResponseBody);
Logging\HttpClientLoggingTagNamesTest.cs (2)
16
var actualDimensions =
HttpClientLoggingTagNames
.TagNames;
17
var expectedDimensions = GetStringConstants(typeof(
HttpClientLoggingTagNames
));
Logging\LoggerMessageStateExtensionsTests.cs (2)
18
HttpClientLoggingTagNames
.RequestHeaderPrefix);
26
HttpClientLoggingTagNames
.ResponseHeaderPrefix);