Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.19.3
-
None
-
Patch Available
-
Unknown
-
Patch
Description
According to the camel doc, the value of CamelLogDebugBodyMaxChars could be 0 or negative which allows entire body to be shown in the debug log.
I noticed the following code in CamelAutoConfiguration.java which only set CamelLogDebugBodyMaxChars when the configuration item is positive.
if (config.getLogDebugMaxChars() > 0) {
camelContext.getGlobalOptions().put(Exchange.LOG_DEBUG_BODY_MAX_CHARS, "" + config.getLogDebugMaxChars());
}
To solve the issue, simply remove the if condition.
diff for the patch:
--- CamelAutoConfiguration.java.old 2017-10-12 14:32:42.000000000 +1100 +++ CamelAutoConfiguration.java 2017-10-12 14:32:57.000000000 +1100 @@ -140,9 +140,7 @@ camelContext.getShutdownStrategy().setShutdownRoutesInReverseOrder(config.isShutdownRoutesInReverseOrder()); camelContext.getShutdownStrategy().setLogInflightExchangesOnTimeout(config.isShutdownLogInflightExchangesOnTimeout()); - if (config.getLogDebugMaxChars() > 0) { - camelContext.getGlobalOptions().put(Exchange.LOG_DEBUG_BODY_MAX_CHARS, "" + config.getLogDebugMaxChars()); - } + camelContext.getGlobalOptions().put(Exchange.LOG_DEBUG_BODY_MAX_CHARS, "" + config.getLogDebugMaxChars()); // stream caching camelContext.setStreamCaching(config.isStreamCachingEnabled());
Attachments
Attachments
Issue Links
- links to