Skip to content

Commit 6314b06

Browse files
committed
Ikke logg sensitiv data i offentlig logg. Logg til sikkerlogg
1 parent 87014e3 commit 6314b06

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

dp-inntekt-api/src/main/kotlin/no/nav/dagpenger/inntekt/inntektskomponenten/v1/InntektskomponentHttpClient.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import no.nav.dagpenger.inntekt.moshiInstance
1313
import no.nav.dagpenger.oidc.OidcClient
1414
import java.time.YearMonth
1515

16-
private val LOGGER = KotlinLogging.logger {}
16+
private val logg = KotlinLogging.logger {}
17+
private val sikkerLogg = KotlinLogging.logger("tjenestekall")
1718
private val jsonResponseAdapter = moshiInstance.adapter(InntektkomponentResponse::class.java)
1819
private val jsonRequestRequestAdapter = moshiInstance.adapter(HentInntektListeRequest::class.java)
1920
private val jsonMapAdapter = moshiInstance.adapter(Map::class.java)
@@ -65,7 +66,7 @@ class InntektskomponentHttpClient(
6566
withLoggingContext(
6667
"callId" to callId
6768
) {
68-
LOGGER.info("Fetching new inntekt for $request")
69+
logg.info("Fetching new inntekt for $request")
6970

7071
try {
7172
val (_, response, result) = with(hentInntektlisteUrl.httpPost()) {
@@ -101,7 +102,8 @@ class InntektskomponentHttpClient(
101102
"Failed to fetch inntekt. Status code ${response.statusCode}. Response message: ${response.responseMessage}. Problem message: $detail",
102103
detail
103104
).also {
104-
LOGGER.error { it }
105+
sikkerLogg.error { it }
106+
logg.error("Failed to fetch inntekt. Status code ${response.statusCode}")
105107
}
106108
}
107109
)

0 commit comments

Comments
 (0)