Skip to content

Commit

Permalink
docfix/Add more logging at the function getUserAndSessionContextFuture
Browse files Browse the repository at this point in the history
  • Loading branch information
constantine2nd committed Oct 5, 2023
1 parent edbf346 commit 91c0e5e
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 91c0e5e

Please sign in to comment.