Description
responseContentLength is a boxed Integer (default null). For a byte-type response with no Content-Length header (chunked/streamed), it stays null. When desensitization is enabled, desensitizeShenyuRequestLog calls .toString() on the null boxed value → NPE. Same unguarded .toString() pattern on status (:192) and upstreamResponseTime (:195).
Location
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-common/src/main/java/org/apache/shenyu/plugin/logging/common/collector/AbstractLogCollector.java:189-190,192,194-195
Impact
NPE thrown inside doFinally on the request thread for desensitization-enabled + byte-type chunked responses; that log lost.
Suggested fix
Null-guard before .toString() (e.g. String.valueOf(logInfo.getResponseContentLength())).
Related existing
None.
Description
responseContentLengthis a boxedInteger(default null). For a byte-type response with noContent-Lengthheader (chunked/streamed), it stays null. When desensitization is enabled,desensitizeShenyuRequestLogcalls.toString()on the null boxed value → NPE. Same unguarded.toString()pattern onstatus(:192) andupstreamResponseTime(:195).Location
shenyu-plugin/shenyu-plugin-logging/shenyu-plugin-logging-common/src/main/java/org/apache/shenyu/plugin/logging/common/collector/AbstractLogCollector.java:189-190,192,194-195Impact
NPE thrown inside
doFinallyon the request thread for desensitization-enabled + byte-type chunked responses; that log lost.Suggested fix
Null-guard before
.toString()(e.g.String.valueOf(logInfo.getResponseContentLength())).Related existing
None.