58 references to HttpLoggingFields
Microsoft.AspNetCore.Diagnostics.Middleware (8)
Logging\HttpLoggingRedactionInterceptor.cs (6)
72logContext.LoggingFields = HttpLoggingFields.None; 77if (!logContext.IsAnyEnabled(HttpLoggingFields.RequestPropertiesAndHeaders)) 85if (logContext.TryDisable(HttpLoggingFields.RequestPath)) 133if (logContext.TryDisable(HttpLoggingFields.RequestHeaders)) 145if (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. 45o.LoggingFields |= HttpLoggingFields.Duration;
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (8)
Logging\AcceptanceTests.cs (8)
210x.LoggingFields |= HttpLoggingFields.ResponseBody; 270x.LoggingFields |= HttpLoggingFields.RequestBody; 323x.LoggingFields |= HttpLoggingFields.RequestBody; 368x.LoggingFields = HttpLoggingFields.All; 686x.LoggingFields |= HttpLoggingFields.RequestBody | HttpLoggingFields.ResponseBody; 720static services => services.AddHttpLogging(static x => x.LoggingFields &= ~HttpLoggingFields.ResponseBody) 961o.LoggingFields = HttpLoggingFields.None;
Microsoft.AspNetCore.HttpLogging (42)
HttpLoggingAttribute.cs (2)
16public HttpLoggingAttribute(HttpLoggingFields loggingFields) 27public HttpLoggingFields LoggingFields { get; }
HttpLoggingEndpointConventionBuilderExtensions.cs (2)
18/// <param name="loggingFields">The <see cref="HttpLoggingFields"/> to apply to this endpoint.</param> 23public 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?)"/>. 47public HttpLoggingFields LoggingFields { get; set; } 55/// <see cref="HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging{TBuilder}(TBuilder, HttpLoggingFields, int?, int?)"/>. 65/// <see cref="HttpLoggingEndpointConventionBuilderExtensions.WithHttpLogging{TBuilder}(TBuilder, HttpLoggingFields, int?, int?)"/>. 97public void Enable(HttpLoggingFields fields) 106public bool IsAnyEnabled(HttpLoggingFields fields) 108return (LoggingFields & fields) != HttpLoggingFields.None; 115public void Disable(HttpLoggingFields fields) 125public bool TryDisable(HttpLoggingFields fields) 139LoggingFields = HttpLoggingFields.None;
HttpLoggingMiddleware.cs (20)
63var loggingFields = loggingAttribute?.LoggingFields ?? options.LoggingFields; 65if (_interceptors.Length == 0 && loggingFields == HttpLoggingFields.None) 75HttpLoggingAttribute? loggingAttribute, HttpLoggingFields loggingFields) 114if (logContext.IsAnyEnabled(HttpLoggingFields.RequestPropertiesAndHeaders | HttpLoggingFields.RequestQuery)) 116if (loggingFields.HasFlag(HttpLoggingFields.RequestProtocol)) 121if (loggingFields.HasFlag(HttpLoggingFields.RequestMethod)) 126if (loggingFields.HasFlag(HttpLoggingFields.RequestScheme)) 131if (loggingFields.HasFlag(HttpLoggingFields.RequestPath)) 137if (loggingFields.HasFlag(HttpLoggingFields.RequestQuery)) 142if (loggingFields.HasFlag(HttpLoggingFields.RequestHeaders)) 157if (loggingFields.HasFlag(HttpLoggingFields.RequestBody)) 192if (logContext.IsAnyEnabled(HttpLoggingFields.ResponsePropertiesAndHeaders)) 206if (loggingFields.HasFlag(HttpLoggingFields.ResponseBody) || _interceptors.Length > 0) 234if (logContext.IsAnyEnabled(HttpLoggingFields.Duration)) 236logContext.AddParameter(nameof(HttpLoggingFields.Duration), logContext.GetDuration()); 262if (logContext.IsAnyEnabled(HttpLoggingFields.Duration)) 336var loggingFields = logContext.LoggingFields; 339if (loggingFields.HasFlag(HttpLoggingFields.ResponseStatusCode)) 344if (loggingFields.HasFlag(HttpLoggingFields.ResponseHeaders))
HttpLoggingOptions.cs (3)
16public 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)
126if (logContext.IsAnyEnabled(HttpLoggingFields.RequestBody))
ResponseBufferingStream.cs (1)
171if (_logContext.LoggingFields.HasFlag(HttpLoggingFields.ResponseBody) && _logContext.ResponseBodyLogLimit > 0)