diff --git a/obp-api/src/main/scala/code/api/util/APIUtil.scala b/obp-api/src/main/scala/code/api/util/APIUtil.scala index 15cd9bf260..29290b8085 100644 --- a/obp-api/src/main/scala/code/api/util/APIUtil.scala +++ b/obp-api/src/main/scala/code/api/util/APIUtil.scala @@ -3022,6 +3022,8 @@ object APIUtil extends MdcLoggable with CustomJsonFormats{ val url = URLDecoder.decode(ObpS.uriAndQueryString.getOrElse(""),"UTF-8") val correlationId = getCorrelationId() val reqHeaders = S.request.openOrThrowException(attemptedToOpenAnEmptyBox).request.headers + val title = s"Request Headers for verb: $verb, URL: $url" + surroundDebugMessage(reqHeaders.map(h => h.name + ": " + h.values.mkString(",")).mkString, title) val remoteIpAddress = getRemoteIpAddress() val res = if (APIUtil.`hasConsent-ID`(reqHeaders)) { // Berlin Group's Consent diff --git a/obp-api/src/main/scala/code/util/Helper.scala b/obp-api/src/main/scala/code/util/Helper.scala index 1a1b7a99c1..55f359d4a1 100644 --- a/obp-api/src/main/scala/code/util/Helper.scala +++ b/obp-api/src/main/scala/code/util/Helper.scala @@ -325,6 +325,11 @@ object Helper extends Loggable { logger.error(s"| $msg |") logger.error(s"+-${StringUtils.repeat("-", msg.length)}-+") } + protected def surroundDebugMessage(msg: String, title: String = ""): Unit = { + logger.debug(s"+-${title}${StringUtils.repeat("-", msg.length - title.length)}-+") + logger.debug(s"| $msg |") + logger.debug(s"+-${StringUtils.repeat("-", msg.length)}-+") + } initiate() MDC.put("host" -> getHostname) }