HttpLoggingInterceptor class

A Interceptor implementation which logs HTTP request and response data.

Log levels can be set by applying level for more fine grained control over amount of information being logged.

Warning: Log messages written by this interceptor have the potential to leak sensitive information, such as Authorization headers and user data in response bodies. This interceptor should only be used in a controlled way or in a non-production environment.

Implemented types
Annotations
  • @immutable

Constructors

HttpLoggingInterceptor({Level level = Level.body, bool onlyErrors = false, Logger? logger})
A Interceptor implementation which logs HTTP request and response data.

Properties

hashCode int
The hash code for this object.
no setterinherited
level Level
final
onlyErrors bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

intercept<BodyType>(Chain<BodyType> chain) FutureOr<Response<BodyType>>
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited