Fallback logger for logging in http and codec packages
Issue: SPR-17012
This commit is contained in:
@@ -40,7 +40,7 @@ import org.springframework.util.MimeType;
|
||||
*/
|
||||
public abstract class AbstractDecoder<T> implements Decoder<T> {
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
protected Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private final List<MimeType> decodableMimeTypes;
|
||||
|
||||
@@ -50,6 +50,24 @@ public abstract class AbstractDecoder<T> implements Decoder<T> {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set an alternative logger to use than the one based on the class name.
|
||||
* @param logger the logger to use
|
||||
* @since 5.1
|
||||
*/
|
||||
public void setLogger(Log logger) {
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the currently configured Logger.
|
||||
* @since 5.1
|
||||
*/
|
||||
public Log getLogger() {
|
||||
return logger;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<MimeType> getDecodableMimeTypes() {
|
||||
return this.decodableMimeTypes;
|
||||
|
||||
@@ -36,7 +36,7 @@ import org.springframework.util.MimeType;
|
||||
*/
|
||||
public abstract class AbstractEncoder<T> implements Encoder<T> {
|
||||
|
||||
protected final Log logger = LogFactory.getLog(getClass());
|
||||
protected Log logger = LogFactory.getLog(getClass());
|
||||
|
||||
private final List<MimeType> encodableMimeTypes;
|
||||
|
||||
@@ -46,6 +46,24 @@ public abstract class AbstractEncoder<T> implements Encoder<T> {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set an alternative logger to use than the one based on the class name.
|
||||
* @param logger the logger to use
|
||||
* @since 5.1
|
||||
*/
|
||||
public void setLogger(Log logger) {
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the currently configured Logger.
|
||||
* @since 5.1
|
||||
*/
|
||||
public Log getLogger() {
|
||||
return logger;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<MimeType> getEncodableMimeTypes() {
|
||||
return this.encodableMimeTypes;
|
||||
|
||||
Reference in New Issue
Block a user