58 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)
28
/// This will enable <see cref="HttpLoggingOptions.CombineLogs"/> and <see cref="
HttpLoggingFields
.Duration"/> by default.
45
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 (42)
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 (20)
63
var
loggingFields = loggingAttribute?.LoggingFields ?? options.LoggingFields;
65
if (_interceptors.Length == 0 && loggingFields ==
HttpLoggingFields
.None)
75
HttpLoggingAttribute? loggingAttribute,
HttpLoggingFields
loggingFields)
114
if (logContext.IsAnyEnabled(
HttpLoggingFields
.RequestPropertiesAndHeaders |
HttpLoggingFields
.RequestQuery))
116
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestProtocol))
121
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestMethod))
126
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestScheme))
131
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestPath))
137
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestQuery))
142
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestHeaders))
157
if (loggingFields.HasFlag(
HttpLoggingFields
.RequestBody))
192
if (logContext.IsAnyEnabled(
HttpLoggingFields
.ResponsePropertiesAndHeaders))
206
if (loggingFields.HasFlag(
HttpLoggingFields
.ResponseBody) || _interceptors.Length > 0)
234
if (logContext.IsAnyEnabled(
HttpLoggingFields
.Duration))
236
logContext.AddParameter(nameof(
HttpLoggingFields
.Duration), logContext.GetDuration());
262
if (logContext.IsAnyEnabled(
HttpLoggingFields
.Duration))
336
var
loggingFields = logContext.LoggingFields;
339
if (loggingFields.HasFlag(
HttpLoggingFields
.ResponseStatusCode))
344
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)