updated logging
This commit is contained in:
parent
066781edb9
commit
8985476e61
@ -31,7 +31,7 @@ class Coordinator() : CoordinatorBase<PersistentMessage, PersistentEventBasedMes
|
|||||||
override fun onMessageReceived(event: DeserializedConsumerRecord<KafkaEvents, Message<out MessageDataWrapper>>) {
|
override fun onMessageReceived(event: DeserializedConsumerRecord<KafkaEvents, Message<out MessageDataWrapper>>) {
|
||||||
val success = eventManager.setEvent(event.key, event.value)
|
val success = eventManager.setEvent(event.key, event.value)
|
||||||
if (!success) {
|
if (!success) {
|
||||||
log.error { "Unable to store message event: ${event.key.event} with eventId ${event.value.eventId} with referenceId ${event.value.referenceId} in database ${getEventsDatabase().database}!" }
|
log.error { "Failed to store message event\nReferenceId: ${event.value.referenceId}\n\tEventId: ${event.value.eventId}\n\tEvent: ${event.key.event}\n\nData:\n${event.value.data}" }
|
||||||
} else {
|
} else {
|
||||||
io.launch {
|
io.launch {
|
||||||
readAllMessagesFor(event.value.referenceId, event.value.eventId, event.key.event)
|
readAllMessagesFor(event.value.referenceId, event.value.eventId, event.key.event)
|
||||||
|
|||||||
@ -202,12 +202,16 @@ class PersistentEventManager(private val dataSource: DataSource) {
|
|||||||
val success = if (exception != null) {
|
val success = if (exception != null) {
|
||||||
if (exception.isExposedSqlException()) {
|
if (exception.isExposedSqlException()) {
|
||||||
if ((exception as ExposedSQLException).isCausedByDuplicateError()) {
|
if ((exception as ExposedSQLException).isCausedByDuplicateError()) {
|
||||||
log.info { "Error is of SQLIntegrityConstraintViolationException" }
|
log.debug { "Error is of SQLIntegrityConstraintViolationException" }
|
||||||
|
log.error { exception.message }
|
||||||
|
exception.printStackTrace()
|
||||||
} else {
|
} else {
|
||||||
log.info { "Error code is: ${exception.errorCode}" }
|
log.debug { "Error code is: ${exception.errorCode}" }
|
||||||
|
log.error { exception.message }
|
||||||
exception.printStackTrace()
|
exception.printStackTrace()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
log.error { exception.message }
|
||||||
exception.printStackTrace()
|
exception.printStackTrace()
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user