96 references to HttpClientLoggingTagNames
Microsoft.Extensions.Http.Diagnostics (32)
Logging\Internal\Log.cs (30)
23
$"{{{
HttpClientLoggingTagNames
.Method}}} {{{
HttpClientLoggingTagNames
.Host}}}/{{{
HttpClientLoggingTagNames
.Path}}}";
27
$"{{{
HttpClientLoggingTagNames
.Method}}} {{{
HttpClientLoggingTagNames
.Host}}}/{{{
HttpClientLoggingTagNames
.Path}}}";
30
$"The logger couldn't read its context for {{RequestState}} request: {{{
HttpClientLoggingTagNames
.Method}}} {{{
HttpClientLoggingTagNames
.Host}}}";
34
$"{{{
HttpClientLoggingTagNames
.Method}}} {{{
HttpClientLoggingTagNames
.Host}}}/{{{
HttpClientLoggingTagNames
.Path}}}";
52
[TagName(
HttpClientLoggingTagNames
.Method)] HttpMethod method,
53
[TagName(
HttpClientLoggingTagNames
.Host)] string? host,
54
[TagName(
HttpClientLoggingTagNames
.Path)] string? path);
60
[TagName(
HttpClientLoggingTagNames
.Method)] HttpMethod method,
61
[TagName(
HttpClientLoggingTagNames
.Host)] string host,
62
[TagName(
HttpClientLoggingTagNames
.Path)] string path);
69
[TagName(
HttpClientLoggingTagNames
.Method)] HttpMethod method,
70
[TagName(
HttpClientLoggingTagNames
.Host)] string? host);
77
[TagName(
HttpClientLoggingTagNames
.Method)] HttpMethod method,
78
[TagName(
HttpClientLoggingTagNames
.Host)] string host,
79
[TagName(
HttpClientLoggingTagNames
.Path)] string path);
101
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.Method, record.Method);
102
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.Host, record.Host);
103
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.Path, record.Path);
104
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.Duration, record.Duration);
108
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.StatusCode, record.StatusCode.Value);
128
loggerMessageState.TagArray[index++] = new(
HttpClientLoggingTagNames
.RequestBody, record.RequestBody);
133
loggerMessageState.TagArray[index] = new(
HttpClientLoggingTagNames
.ResponseBody, record.ResponseBody);
164
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);