Add option to log all requests and responses.

This commit is contained in:
Anatoliy Sablin
2020-05-06 23:46:34 +03:00
parent 53c4ffdc4e
commit 9c4faab5d8
9 changed files with 450 additions and 7 deletions

View File

@@ -10,6 +10,7 @@ public class LoggingConfig {
private String root;
private String app;
private boolean requests = false;
public String getRoot() {
return root;
@@ -27,6 +28,14 @@ public class LoggingConfig {
this.app = app;
}
public boolean isRequests() {
return requests;
}
public void setRequests(boolean requests) {
this.requests = requests;
}
public void build() {
LOGGER.info("Logging config:");
if (StringUtils.isNotBlank(getRoot())) {
@@ -43,5 +52,9 @@ public class LoggingConfig {
} else {
LOGGER.info(" Logging level hasn't set, use default");
}
LOGGER.info(" Log requests: {}", isRequests());
if (isRequests()) {
LOGGER.warn(" Request dumping enabled, use this only to debug purposes, don't use it in the production.");
}
}
}