This is an automated email from the ASF dual-hosted git repository.
mridulpathak pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-plugins.git
The following commit(s) were added to refs/heads/release24.09 by this push:
new e77fedb69 Log only the headers of REST requests and responses in
verbose mode
e77fedb69 is described below
commit e77fedb69b33dc56acb614c697c959edd67c514c
Author: Mridul Pathak <[email protected]>
AuthorDate: Sat Oct 24 14:55:42 2026 +0530
Log only the headers of REST requests and responses in verbose mode
Backported from apache/ofbiz-framework#2414, where rest-api is part of the
framework. With apache/ofbiz-framework#2415, java.util.logging reaches the log
files on release24.09 too, so this should be merged together with it.
---
.../main/java/org/apache/ofbiz/ws/rs/core/OFBizApiConfig.java | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git
a/rest-api/src/main/java/org/apache/ofbiz/ws/rs/core/OFBizApiConfig.java
b/rest-api/src/main/java/org/apache/ofbiz/ws/rs/core/OFBizApiConfig.java
index 579e11de9..7633da8c1 100644
--- a/rest-api/src/main/java/org/apache/ofbiz/ws/rs/core/OFBizApiConfig.java
+++ b/rest-api/src/main/java/org/apache/ofbiz/ws/rs/core/OFBizApiConfig.java
@@ -63,8 +63,13 @@ public class OFBizApiConfig extends ResourceConfig {
register(MultiPartFeature.class);
register(ServiceContextCleanupFilter.class);
if (Debug.verboseOn()) {
- register(new
LoggingFeature(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), Level.INFO,
- LoggingFeature.Verbosity.PAYLOAD_ANY, 10000));
+ // headers only, the ones carrying credentials or tokens being
redacted: bodies can hold credentials and tokens
+ register(LoggingFeature.builder()
+
.withLogger(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME))
+ .level(Level.INFO)
+ .verbosity(LoggingFeature.Verbosity.HEADERS_ONLY)
+ .redactHeaders(List.of("Authorization",
"Proxy-Authorization", "Cookie", "Set-Cookie", "Refresh-Token"))
+ .build());
}
registerDSLResources();
}