Skip to content

Commit

Permalink
Merge pull request #2284 from constantine2nd/develop
Browse files Browse the repository at this point in the history
Add more logging at the function getUserAndSessionContextFuture
  • Loading branch information
simonredfern committed Oct 5, 2023
2 parents ca9684a + 91c0e5e commit 16f53c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions obp-api/src/main/scala/code/api/util/APIUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions obp-api/src/main/scala/code/util/Helper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 16f53c6

Please sign in to comment.