mirror of https://github.com/apache/nifi.git
NIFI-10863 Added conditional InvokeHTTP HTTP debug log
- Wrapping if statements prevent them from being called at all if debug logging is disabled This closes #6706 Signed-off-by: David Handermann <exceptionfactory@apache.org>
This commit is contained in:
parent
8b71edd61a
commit
6a9cb9c10c
|
@ -1299,13 +1299,17 @@ public class InvokeHTTP extends AbstractProcessor {
|
|||
}
|
||||
|
||||
private void logRequest(ComponentLog logger, Request request) {
|
||||
logger.debug("\nRequest to remote service:\n\t{}\n{}",
|
||||
request.url().url().toExternalForm(), getLogString(request.headers().toMultimap()));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("\nRequest to remote service:\n\t{}\n{}",
|
||||
request.url().url().toExternalForm(), getLogString(request.headers().toMultimap()));
|
||||
}
|
||||
}
|
||||
|
||||
private void logResponse(ComponentLog logger, URL url, Response response) {
|
||||
logger.debug("\nResponse from remote service:\n\t{}\n{}",
|
||||
url.toExternalForm(), getLogString(response.headers().toMultimap()));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("\nResponse from remote service:\n\t{}\n{}",
|
||||
url.toExternalForm(), getLogString(response.headers().toMultimap()));
|
||||
}
|
||||
}
|
||||
|
||||
private String getLogString(Map<String, List<String>> map) {
|
||||
|
|
Loading…
Reference in New Issue