Skip to content

Commit

Permalink
6486 Fjerning av logging av ident (#637)
Browse files Browse the repository at this point in the history
Erstatt ident med xxxxxxxxxxx i error logging
  • Loading branch information
RuneLind authored Mar 5, 2024
1 parent 054aa60 commit 1410375
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,18 @@ public void oppgaveHendelse(ConsumerRecord<String, OppgaveKafkaAivenRecord> cons
oppgaveEndretService.behandleOppgaveEndretHendelse(oppgaveEndretHendelse);
} catch (Exception e) {
String message = e.getMessage() != null ? e.getMessage() : e.getClass().getSimpleName();
log.error("Klarte ikke å konsumere melding om oppgave endret: {}\n{}", message, consumerRecord, e);
log.error("Klarte ikke å konsumere melding om oppgave endret: {}\n{}", message, toString(consumerRecord), e);

kafkaDLQService.lagreOppgaveEndretHendelse(oppgaveEndretHendelse, e.getMessage());
} finally {
remove(CORRELATION_ID);
}
}

private static String toString(ConsumerRecord<String, OppgaveKafkaAivenRecord> consumerRecord) {
// fjern ident for å anonymisere
return consumerRecord.toString().replaceAll("\\bident=\\d+", "ident=xxxxxxxxxxx");
}
public void settSpesifiktOffsetPåConsumer(long offset) {
getSeekCallbacks().forEach((tp, callback) -> callback.seek(tp.topic(), tp.partition(), offset));
}
Expand Down

0 comments on commit 1410375

Please sign in to comment.