61 references to HttpLoggingFields
Microsoft.AspNetCore.Diagnostics.Middleware (8)
Logging\HttpLoggingRedactionInterceptor.cs (6)
72
logContext.LoggingFields =
HttpLoggingFields
.None;
77
if (!logContext.IsAnyEnabled(
HttpLoggingFields
.RequestPropertiesAndHeaders))
85
if (logContext.TryDisable(
HttpLoggingFields
.RequestPath))
133
if (logContext.TryDisable(
HttpLoggingFields
.RequestHeaders))
145
if (logContext.TryDisable(
HttpLoggingFields
.ResponseHeaders))
152
|| (!logContext.IsAnyEnabled(
HttpLoggingFields
.Response) && logContext.Parameters.Count == 0))
Logging\HttpLoggingServiceCollectionExtensions.cs (2)
29
/// This will enable <see cref="HttpLoggingOptions.CombineLogs"/> and <see cref="
HttpLoggingFields
.Duration"/> by default.
48
o.LoggingFields |=
HttpLoggingFields
.Duration;
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (8)
Logging\AcceptanceTests.cs (8)
210
x.LoggingFields |=
HttpLoggingFields
.ResponseBody;
270
x.LoggingFields |=
HttpLoggingFields
.RequestBody;
323
x.LoggingFields |=
HttpLoggingFields
.RequestBody;
368
x.LoggingFields =
HttpLoggingFields
.All;
686
x.LoggingFields |=
HttpLoggingFields
.RequestBody |
HttpLoggingFields
.ResponseBody;
720
static services => services.AddHttpLogging(static x => x.LoggingFields &= ~
HttpLoggingFields
.ResponseBody)
961
o.LoggingFields =
HttpLoggingFields
.None;
Microsoft.AspNetCore.HttpLogging (45)
HttpLoggingAttribute.cs (2)
16
public HttpLoggingAttribute(
HttpLoggingFields
loggingFields)
27
public
HttpLoggingFields
LoggingFields { get; }
HttpLoggingEndpointConventionBuilderExtensions.cs (2)
18
/// <param name="loggingFields">The <see cref="
HttpLoggingFields
"/> to apply to this endpoint.</param>
23
public static TBuilder WithHttpLogging<TBuilder>(this TBuilder builder,
HttpLoggingFields
loggingFields, int? requestBodyLogLimit = null, int? responseBodyLogLimit = null) where TBuilder : IEndpointConventionBuilder
HttpLoggingInterceptorContext.cs (11)
15
/// <see cref="HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging{TBuilder}(TBuilder,
HttpLoggingFields
, int?, int?)" />.
45
/// <see cref="HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging{TBuilder}(TBuilder,
HttpLoggingFields
, int?, int?)"/>.
47
public
HttpLoggingFields
LoggingFields { get; set; }
55
/// <see cref="HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging{TBuilder}(TBuilder,
HttpLoggingFields
, int?, int?)"/>.
65
/// <see cref="HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging{TBuilder}(TBuilder,
HttpLoggingFields
, int?, int?)"/>.
97
public void Enable(
HttpLoggingFields
fields)
106
public bool IsAnyEnabled(
HttpLoggingFields
fields)
108
return (LoggingFields & fields) !=
HttpLoggingFields
.None;
115
public void Disable(
HttpLoggingFields
fields)
125
public bool TryDisable(
HttpLoggingFields
fields)
139
LoggingFields =
HttpLoggingFields
.None;
HttpLoggingMiddleware.cs (23)
67
var
loggingFields = loggingAttribute?.LoggingFields ?? options.LoggingFields;
69
if (_interceptors.Length == 0 && loggingFields ==
HttpLoggingFields
.None)
79
HttpLoggingAttribute? loggingAttribute,
HttpLoggingFields
loggingFields)
118
if (logContext.IsAnyEnabled(
HttpLoggingFields
.RequestPropertiesAndHeaders |
HttpLoggingFields
.RequestQuery))
123
+ (loggingFields.HasFlag(
HttpLoggingFields
.RequestHeaders) ? request.Headers.Count : 0));
125
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestProtocol))
130
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestMethod))
135
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestScheme))
140
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestPath))
146
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestQuery))
151
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestHeaders))
166
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestBody))
201
if (logContext.IsAnyEnabled(
HttpLoggingFields
.ResponsePropertiesAndHeaders))
215
if (loggingFields.HasFlag(
HttpLoggingFields
.ResponseBody) || _interceptors.Length > 0)
243
if (logContext.IsAnyEnabled(
HttpLoggingFields
.Duration))
245
logContext.AddParameter(nameof(
HttpLoggingFields
.Duration), logContext.GetDuration());
271
if (logContext.IsAnyEnabled(
HttpLoggingFields
.Duration))
345
var
loggingFields = logContext.LoggingFields;
348
if (logContext.IsAnyEnabled(
HttpLoggingFields
.ResponsePropertiesAndHeaders))
353
+ (loggingFields.HasFlag(
HttpLoggingFields
.ResponseHeaders) ? response.Headers.Count : 0));
356
if (loggingFields.HasFlag(
HttpLoggingFields
.ResponseStatusCode))
361
if (loggingFields.HasFlag(
HttpLoggingFields
.ResponseHeaders))
HttpLoggingOptions.cs (3)
16
public
HttpLoggingFields
LoggingFields { get; set; } =
HttpLoggingFields
.RequestPropertiesAndHeaders |
HttpLoggingFields
.ResponsePropertiesAndHeaders;
IHttpLoggingInterceptor.cs (2)
33
/// and be logged together. <see cref="
HttpLoggingFields
.RequestBody"/> and <see cref="
HttpLoggingFields
.ResponseBody"/> can also be disabled in OnResponseAsync to prevent
RequestBufferingStream.cs (1)
126
if (logContext.IsAnyEnabled(
HttpLoggingFields
.RequestBody))
ResponseBufferingStream.cs (1)
171
if (_logContext.LoggingFields.HasFlag(
HttpLoggingFields
.ResponseBody) && _logContext.ResponseBodyLogLimit > 0)