Skip to content

Commit

Permalink
Logg penere json
Browse files Browse the repository at this point in the history
  • Loading branch information
bjerga committed Dec 23, 2024
1 parent e12daac commit 54d02c7
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,30 @@ package no.nav.helsearbeidsgiver.inntektsmelding.feilbehandler.prosessor
import com.github.navikt.tbd_libs.rapids_and_rivers_api.RapidsConnection
import no.nav.hag.utils.bakgrunnsjobb.Bakgrunnsjobb
import no.nav.hag.utils.bakgrunnsjobb.BakgrunnsjobbProsesserer
import no.nav.helsearbeidsgiver.utils.json.parseJson
import no.nav.helsearbeidsgiver.utils.json.toPretty
import no.nav.helsearbeidsgiver.utils.log.logger
import no.nav.helsearbeidsgiver.utils.log.sikkerLogger

class FeilProsessor(
private val rapid: RapidsConnection,
) : BakgrunnsjobbProsesserer {
private val logger = logger()
private val sikkerLogger = sikkerLogger()

override val type: String
get() = JOB_TYPE

companion object {
const val JOB_TYPE = "kafka-retry-message"
}

private val sikkerLogger = sikkerLogger()

override fun prosesser(jobb: Bakgrunnsjobb) {
sikkerLogger.info("Prosesserer jobb - rekjører melding med id ${jobb.uuid}")
sikkerLogger.debug("Sender melding: ${jobb.data}")
"Prosesserer jobb - rekjører melding med ID '${jobb.uuid}'.".also {
logger.info(it)
sikkerLogger.info(it)
}
sikkerLogger.debug("Sender melding.\n${jobb.data.parseJson().toPretty()}")
rapid.publish(jobb.data)
}
}

0 comments on commit 54d02c7

Please sign in to comment.