Skip to content

Commit

Permalink
More logs to check when it fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
MalazAlkoj committed Sep 3, 2024
1 parent d0c7254 commit dd96240
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ class NarmesteLederClient(
): List<NarmesteLederRelasjonDTO> {
val issuerToken = TokenUtil.getIssuerToken(contextHolder, TokenXUtil.TokenXIssuer.TOKENX)
val exchangedToken = tokenDingsConsumer.exchangeToken(issuerToken, targetApp)

log.info("ExchangedToken: $exchangedToken")
try {
val response = getResponse(
fnr = ansattFnr,
accessToken = exchangedToken
)

log.info("Response from NarmesteLeder: ${response.body}")
val relasjoner = response.body ?: emptyArray()

log.info("Relasjoner: $relasjoner")
return relasjoner
.filter { it.arbeidstakerPersonIdentNumber == ansattFnr }
} catch (e: RestClientResponseException) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ class NarmesteLederController @Autowired constructor(
"${LocalDate.now()}"
)*/
val narmesteLedere = narmesteLederClient.alleLedereForSykmeldt(ansattFnr = innloggetIdent)

LOG.info("Hentet nærmeste ledere for $innloggetIdent: $narmesteLedere")
LOG.info("Hentet nærmeste ledere for $innloggetIdent: ${narmesteLedere.size}")
LOG.info("Hentet nærmeste ledere for $innloggetIdent: ${narmesteLedere.map { it.narmesteLederNavn }}")
return if (narmesteLedere.isNotEmpty()) {
ResponseEntity
.status(HttpStatus.OK)
Expand Down

0 comments on commit dd96240

Please sign in to comment.