Package org.springframework.http.codec

# Class LoggingCodecSupport

java.lang.Object
org.springframework.http.codec.LoggingCodecSupport

Direct Known Subclasses:
  `DefaultPartHttpMessageReader`, `FormHttpMessageReader`, `FormHttpMessageWriter`, `MultipartHttpMessageReader`, `MultipartWriterSupport`, `PartEventHttpMessageReader`

public class LoggingCodecSupport extends Object
Base class for `Encoder`, `Decoder`, `HttpMessageReader`, or `HttpMessageWriter` that uses a logger and shows potentially sensitive request data.

Since:
  5.1
Author:
  Rossen Stoyanchev

## Field Summary

Fields
Modifier and Type
Field
Description
`protected final org.apache.commons.logging.Log`
`logger`

## Constructor Summary

Constructors
Constructor
Description
`LoggingCodecSupport()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`isEnableLoggingRequestDetails()`
Whether any logging of values being encoded or decoded is explicitly disabled regardless of log level.
`void`
`setEnableLoggingRequestDetails(boolean enable)`
Whether to log form data at DEBUG level, and headers at TRACE level.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### logger

protected final org.apache.commons.logging.Log logger

## Constructor Details

### LoggingCodecSupport

public LoggingCodecSupport()

## Method Details

### setEnableLoggingRequestDetails

public void setEnableLoggingRequestDetails(boolean enable)
Whether to log form data at DEBUG level, and headers at TRACE level. Both may contain sensitive information.

By default set to `false` so that request details are not shown.

Parameters:
  `enable` - whether to enable or not

### isEnableLoggingRequestDetails

public boolean isEnableLoggingRequestDetails()
Whether any logging of values being encoded or decoded is explicitly disabled regardless of log level.