cn.bestwu.logging.RequestLoggingProperties Maven / Gradle / Ivy
package cn.bestwu.logging;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* RequestLogging 配置
*
* @author Peter Wu
*/
@ConfigurationProperties("logging.request")
public class RequestLoggingProperties {
private boolean includeRequestBody = false;
private boolean includeResponseBody = false;
private boolean includeTrace = true;
private boolean format = false;
private boolean requestBodyAsString = true;
private boolean responseBodyAsString = true;
/**
* 需要记录日志的 Controller类名前缀.如果为空记录所有 Controller类.
*/
private String[] handlerTypePrefix = new String[0];
/**
* Comma-separated list of paths to exclude from the default logging paths.
*/
private String[] ignored = {"*.js", "*.gif", "*.jpg", "*.png", "*.css", "*.ico"};
/**
* 额外包含的需要记录日志的路径
*/
private String[] includePath = {};
/**
* 加密参数名
*/
private String[] encryptParameters = new String[0];
/**
* 加密请求头名
*/
private String[] encryptHeaders = new String[0];
//--------------------------------------------
public boolean isIncludeRequestBody() {
return includeRequestBody;
}
public void setIncludeRequestBody(boolean includeRequestBody) {
this.includeRequestBody = includeRequestBody;
}
public boolean isIncludeResponseBody() {
return includeResponseBody;
}
public void setIncludeResponseBody(boolean includeResponseBody) {
this.includeResponseBody = includeResponseBody;
}
public boolean isIncludeTrace() {
return includeTrace;
}
public void setIncludeTrace(boolean includeTrace) {
this.includeTrace = includeTrace;
}
public boolean isRequestBodyAsString() {
return requestBodyAsString;
}
public void setRequestBodyAsString(boolean requestBodyAsString) {
this.requestBodyAsString = requestBodyAsString;
}
public boolean isResponseBodyAsString() {
return responseBodyAsString;
}
public void setResponseBodyAsString(boolean responseBodyAsString) {
this.responseBodyAsString = responseBodyAsString;
}
public String[] getHandlerTypePrefix() {
return handlerTypePrefix;
}
public void setHandlerTypePrefix(String[] handlerTypePrefix) {
this.handlerTypePrefix = handlerTypePrefix;
}
public String[] getIgnored() {
return ignored;
}
public void setIgnored(String[] ignored) {
this.ignored = ignored;
}
public boolean isFormat() {
return format;
}
public void setFormat(boolean format) {
this.format = format;
}
public String[] getEncryptParameters() {
return encryptParameters;
}
public void setEncryptParameters(String[] encryptParameters) {
this.encryptParameters = encryptParameters;
}
public String[] getEncryptHeaders() {
return encryptHeaders;
}
public void setEncryptHeaders(String[] encryptHeaders) {
this.encryptHeaders = encryptHeaders;
}
public String[] getIncludePath() {
return includePath;
}
public void setIncludePath(String[] includePath) {
this.includePath = includePath;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy